commit - 66bd0b1c1064405df759d617cd7c068f69acd4fa
commit + 2569c5975ff446cdbf528a05abed3e3ee296ef1c
blob - 6ac39fd8390e60c02019037096662ff2a57c78c1
blob + ed26cfbe42a2edae15431eafee0799f80e423dcf
--- include/statbar.h
+++ include/statbar.h
extern void close_weather(void);
/* Mail */
-extern char mail_string[5];
+extern char mail_string[7];
extern bool get_mail(void);
extern char **get_mail_path_ptr(void);
extern void close_mail(void);
/* Network */
-extern char network_string[5];
+extern char network_string[7];
extern bool init_network_socket(int *fd);
extern void read_network_socket(int fd);
blob - 9180122023a0b244b08249f3e666a1e66d8b76fb
blob + 831622e305ba0930a787c90c60cc59b6d52f954a
--- modules/mail.c
+++ modules/mail.c
#include "statbar.h"
-char mail_string[5];
+char mail_string[7];
static char *mail_path;
(strcmp(dp->d_name, ".") != 0
&& strcmp(dp->d_name, "..") != 0)) break;
}
- (void)snprintf(mail_string, 4, "%s", dp ? MAIL : " ");
+ (void)snprintf(mail_string, 7, "%s ", dp ? MAIL : "");
(void)closedir(dir);
return true;
blob - 32ecda3cfc75f04bb7e246ac462680711f03d230
blob + 735cfe0d446799766b75ab6ebef37a4c30facada
--- modules/network.c
+++ modules/network.c
#include "statbar.h"
-char network_string[5];
+char network_string[7];
static char ethernet_device[IF_NAMESIZE];
static char wifi_device[IF_NAMESIZE];
return;
}
- if (strcmp(ifname, ethernet_device) == 0) (void)strcpy(network_string, ETHERNET);
- else if (strcmp(ifname, wifi_device) == 0) (void)strcpy(network_string, WIFI);
+ if (strcmp(ifname, ethernet_device) == 0) (void)snprintf(network_string, 7, "%s ", ETHERNET);
+ else if (strcmp(ifname, wifi_device) == 0) (void)snprintf(network_string, 7, "%s ", WIFI);
}
void
continue;
}
- if (strcmp(ifname, wifi_device) == 0) (void)strcpy(network_string, WIFI);
- if (strcmp(ifname, ethernet_device) == 0) (void)strcpy(network_string, ETHERNET);
+ if (strcmp(ifname, wifi_device) == 0) (void)snprintf(network_string, 7, "%s ", WIFI);
+ if (strcmp(ifname, ethernet_device) == 0) (void)snprintf(network_string, 7, "%s ", ETHERNET);
}
free(buf);
blob - 87f55d1a04d52dcae9fa214c9a70008fde5a41da
blob + 661684782c4ca600416708e037aeb84991c04aba
--- src/main.c
+++ src/main.c
if (dirty)
{
- (void)snprintf(statbar_text, MAX_STATBAR_LEN, "%s%s | %s | %s | %s | %s | %s | %s",
+ (void)snprintf(statbar_text, MAX_STATBAR_LEN, "%s%s| %s | %s | %s | %s | %s | %s",
mail_string,
network_string,
weather_string,