Fixed some warnings

This commit is contained in:
TheDarkBug 2022-03-08 21:28:42 +01:00
parent 543ddbb367
commit c7f9499c24

View file

@ -253,7 +253,7 @@ int pkgman(struct info* user_info)
unsigned int pkg_count = 0; unsigned int pkg_count = 0;
if (fscanf(fp, "%u", &pkg_count) == 3) continue; // if a number is found, continue the loop if (fscanf(fp, "%u", &pkg_count) == 3) continue; // if a number is found, continue the loop
fclose(fp); pclose(fp);
// adding a package manager with its package count to user_info->pkgman_name // adding a package manager with its package count to user_info->pkgman_name
total += pkg_count; total += pkg_count;
@ -1007,7 +1007,7 @@ struct info get_info()
FILE* whoami = popen("whoami", "r"); FILE* whoami = popen("whoami", "r");
if (fscanf(whoami, "%s", user_info.user) == 3) if (fscanf(whoami, "%s", user_info.user) == 3)
sprintf(user_info.user, "unknown"); sprintf(user_info.user, "unknown");
fclose(whoami); pclose(whoami);
// model name // model name
model_fp = popen("getprop ro.product.model", "r"); model_fp = popen("getprop ro.product.model", "r");
while (fgets(buffer, sizeof(buffer), model_fp) && !sscanf(buffer, "%[^\n]", user_info.model)) while (fgets(buffer, sizeof(buffer), model_fp) && !sscanf(buffer, "%[^\n]", user_info.model))