aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhwspeedy <ns@bigbear.dk>2024-03-14 13:25:09 +0100
committerhwspeedy <ns@bigbear.dk>2024-03-14 13:25:09 +0100
commit48039e8c9350c9e55d3d939d430dd4f9dfd288c5 (patch)
tree9364ce21b5bfaad264fd0297471ff821659bf4a7
parent66246c7746387b27f22581befa76c12bdbf242f0 (diff)
FIX GCC warnings and 3 potential crash never seen
-rw-r--r--modules/benchmark.c2
-rw-r--r--modules/computer/alsa.c2
-rw-r--r--modules/computer/modules.c2
-rw-r--r--modules/computer/uptime.c2
-rw-r--r--modules/devices/battery.c2
-rw-r--r--modules/devices/dmi.c2
-rw-r--r--modules/devices/storage.c10
-rw-r--r--modules/network.c6
8 files changed, 14 insertions, 14 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 511c984e..59f81501 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -518,7 +518,7 @@ static gchar *benchmark_include_results_internal(bench_value this_machine_value,
ShellOrderType order_type)
{
bench_result *this_machine;
- GSList *result_list, *li;
+ GSList *result_list=NULL, *li;
gchar *results = g_strdup("");
gchar *output;
gchar *path;
diff --git a/modules/computer/alsa.c b/modules/computer/alsa.c
index f74d2752..de20a0ad 100644
--- a/modules/computer/alsa.c
+++ b/modules/computer/alsa.c
@@ -63,7 +63,7 @@ computer_get_alsainfo(void)
ai->cards = g_slist_append(ai->cards, ac);
g_strfreev(tmp);
- (void)fgets(buffer, 128, cards); /* skip next line */
+ char *c=fgets(buffer, 128, cards); /* skip next line */
}
fclose(cards);
diff --git a/modules/computer/modules.c b/modules/computer/modules.c
index cec2d42e..e3423ed8 100644
--- a/modules/computer/modules.c
+++ b/modules/computer/modules.c
@@ -265,7 +265,7 @@ void scan_modules_do(void) {
return;
}
- (void)fgets(buffer, 1024, lsmod); /* Discards the first line */
+ char *c=fgets(buffer, 1024, lsmod); /* Discards the first line */
//Sort modules
while (fgets(buffer, 1024, lsmod)) {
diff --git a/modules/computer/uptime.c b/modules/computer/uptime.c
index 8aef1530..f213442f 100644
--- a/modules/computer/uptime.c
+++ b/modules/computer/uptime.c
@@ -26,7 +26,7 @@ computer_get_uptime(void)
gulong minutes;
if ((procuptime = fopen("/proc/uptime", "r")) != NULL) {
- (void)fscanf(procuptime, "%lu", &minutes);
+ int c=fscanf(procuptime, "%lu", &minutes);
ui->minutes = minutes / 60;
fclose(procuptime);
} else {
diff --git a/modules/devices/battery.c b/modules/devices/battery.c
index e356c14a..784a6cc5 100644
--- a/modules/devices/battery.c
+++ b/modules/devices/battery.c
@@ -312,7 +312,7 @@ __scan_battery_apm(void)
if ((procapm = fopen("/proc/apm", "r"))) {
int old_percentage = percentage;
- (void)fscanf(procapm, "%s %s %s 0x%x %s %s %d%%",
+ int c=fscanf(procapm, "%s %s %s 0x%x %s %s %d%%",
apm_drv_ver, apm_bios_ver, trash,
&ac_bat, trash, trash, &percentage);
fclose(procapm);
diff --git a/modules/devices/dmi.c b/modules/devices/dmi.c
index 34374fbe..af02e6d4 100644
--- a/modules/devices/dmi.c
+++ b/modules/devices/dmi.c
@@ -73,7 +73,7 @@ gboolean dmi_get_info(void)
DMIInfo *info;
gboolean dmi_succeeded = FALSE;
guint i;
- gchar *value;
+ gchar *value=NULL;
const gchar *vendor;
if (dmi_info) {
diff --git a/modules/devices/storage.c b/modules/devices/storage.c
index bbf9b195..c0bee0d2 100644
--- a/modules/devices/storage.c
+++ b/modules/devices/storage.c
@@ -632,7 +632,7 @@ void __scan_ide_devices(void)
if (!proc_ide)
continue;
- (void) fgets(buf, 128, proc_ide);
+ char *cc=fgets(buf, 128, proc_ide);
fclose(proc_ide);
buf[strlen(buf) - 1] = 0;
@@ -648,7 +648,7 @@ void __scan_ide_devices(void)
continue;
}
- (void) fgets(buf, 128, proc_ide);
+ char *c=fgets(buf, 128, proc_ide);
fclose(proc_ide);
buf[strlen(buf) - 1] = 0;
@@ -717,7 +717,7 @@ void __scan_ide_devices(void)
if (g_file_test(device, G_FILE_TEST_EXISTS)) {
proc_ide = fopen(device, "r");
if (proc_ide) {
- (void) fscanf(proc_ide, "%d", &cache);
+ int c=fscanf(proc_ide, "%d", &cache);
fclose(proc_ide);
} else {
cache = 0;
@@ -731,7 +731,7 @@ void __scan_ide_devices(void)
proc_ide = fopen(device, "r");
if (proc_ide) {
- (void) fgets(buf, 64, proc_ide);
+ char *c=fgets(buf, 64, proc_ide);
for (tmp = buf; *tmp; tmp++) {
if (*tmp >= '0' && *tmp <= '9')
break;
@@ -739,7 +739,7 @@ void __scan_ide_devices(void)
pgeometry = g_strdup(g_strstrip(tmp));
- (void) fgets(buf, 64, proc_ide);
+ char *cc=fgets(buf, 64, proc_ide);
for (tmp = buf; *tmp; tmp++) {
if (*tmp >= '0' && *tmp <= '9')
break;
diff --git a/modules/network.c b/modules/network.c
index a9f96b41..e89e1b6b 100644
--- a/modules/network.c
+++ b/modules/network.c
@@ -196,8 +196,8 @@ void scan_route(gboolean reload)
if ((route = popen(command_line, "r"))) {
/* eat first two lines */
- (void)fgets(buffer, 256, route);
- (void)fgets(buffer, 256, route);
+ char *c=fgets(buffer, 256, route);
+ char *cc=fgets(buffer, 256, route);
while (fgets(buffer, 256, route)) {
buffer[15] = '\0';
@@ -236,7 +236,7 @@ void scan_arp(gboolean reload)
if ((arp = fopen("/proc/net/arp", "r"))) {
/* eat first line */
- (void)fgets(buffer, 256, arp);
+ char *c=fgets(buffer, 256, arp);
while (fgets(buffer, 256, arp)) {
buffer[15] = '\0';