aboutsummaryrefslogtreecommitdiff
path: root/modules/computer
diff options
context:
space:
mode:
Diffstat (limited to 'modules/computer')
-rw-r--r--modules/computer/alsa.c6
-rw-r--r--modules/computer/boots.c2
-rw-r--r--modules/computer/display.c1
-rw-r--r--modules/computer/modules.c4
-rw-r--r--modules/computer/os.c1
-rw-r--r--modules/computer/ubuntu_flavors.c2
-rw-r--r--modules/computer/uptime.c2
7 files changed, 8 insertions, 10 deletions
diff --git a/modules/computer/alsa.c b/modules/computer/alsa.c
index de20a0ad..3380c003 100644
--- a/modules/computer/alsa.c
+++ b/modules/computer/alsa.c
@@ -51,8 +51,8 @@ computer_get_alsainfo(void)
return NULL;
ai = g_new0(AlsaInfo, 1);
-
- while (fgets(buffer, 128, cards)) {
+ char *c=(char *)1;
+ while (c && (c=fgets(buffer, 128, cards))) {
gchar **tmp;
ac = g_new0(AlsaCard, 1);
@@ -63,7 +63,7 @@ computer_get_alsainfo(void)
ai->cards = g_slist_append(ai->cards, ac);
g_strfreev(tmp);
- char *c=fgets(buffer, 128, cards); /* skip next line */
+ c=fgets(buffer, 128, cards); /* skip next line */
}
fclose(cards);
diff --git a/modules/computer/boots.c b/modules/computer/boots.c
index 52c122e4..40827649 100644
--- a/modules/computer/boots.c
+++ b/modules/computer/boots.c
@@ -41,7 +41,7 @@ scan_boots_real(void)
&out, &err, NULL, NULL);
if (spawned && out != NULL) {
p = out;
- while(next_nl = strchr(p, '\n')) {
+ while((next_nl = strchr(p, '\n'))) {
strend(p, '\n');
if (strstr(p, "system boot")) {
s = p;
diff --git a/modules/computer/display.c b/modules/computer/display.c
index 98cb7bf7..e1b35ad9 100644
--- a/modules/computer/display.c
+++ b/modules/computer/display.c
@@ -26,7 +26,6 @@ DisplayInfo *computer_get_display(void) {
wl_info *wl = get_walyand_info();
xinfo *xi = xinfo_get_info();
xrr_info *xrr = xi->xrr;
- glx_info *glx = xi->glx;
di->width = di->height = 0;
if (xrr->screen_count > 0) {
diff --git a/modules/computer/modules.c b/modules/computer/modules.c
index e3423ed8..a2e53d8a 100644
--- a/modules/computer/modules.c
+++ b/modules/computer/modules.c
@@ -227,7 +227,7 @@ static const gchar* get_module_icon(const char *modname, const char *path)
return NULL;
const gchar *path_no_prefix = path + strlen(kernel_modules_dir);
- const size_t path_no_prefix_len = strlen(path_no_prefix);
+ //const size_t path_no_prefix_len = strlen(path_no_prefix);
int i;
for (i = 0; modules_icons[i].dir; i++) {
@@ -266,7 +266,7 @@ void scan_modules_do(void) {
}
char *c=fgets(buffer, 1024, lsmod); /* Discards the first line */
-
+ if(!c) return;
//Sort modules
while (fgets(buffer, 1024, lsmod)) {
list=g_list_prepend(list,g_strdup(buffer));
diff --git a/modules/computer/os.c b/modules/computer/os.c
index 0b6bb021..c8bee8d3 100644
--- a/modules/computer/os.c
+++ b/modules/computer/os.c
@@ -516,7 +516,6 @@ computer_get_os(void)
{
struct utsname utsbuf;
OperatingSystem *os;
- int i;
os = g_new0(OperatingSystem, 1);
diff --git a/modules/computer/ubuntu_flavors.c b/modules/computer/ubuntu_flavors.c
index ac67d665..c88dc5ff 100644
--- a/modules/computer/ubuntu_flavors.c
+++ b/modules/computer/ubuntu_flavors.c
@@ -66,7 +66,7 @@ GSList *ubuntu_flavors_scan(void) {
&out, &err, &exit_status, NULL);
if (spawned) {
p = out;
- while(next_nl = strchr(p, '\n')) {
+ while((next_nl = strchr(p, '\n'))) {
strend(p, '\n');
int mc = 0;
char pkg[32] = "";
diff --git a/modules/computer/uptime.c b/modules/computer/uptime.c
index f213442f..d12d1c2f 100644
--- a/modules/computer/uptime.c
+++ b/modules/computer/uptime.c
@@ -27,7 +27,7 @@ computer_get_uptime(void)
if ((procuptime = fopen("/proc/uptime", "r")) != NULL) {
int c=fscanf(procuptime, "%lu", &minutes);
- ui->minutes = minutes / 60;
+ if(c) ui->minutes = minutes / 60;
fclose(procuptime);
} else {
g_free(ui);