commit 2569c5975ff446cdbf528a05abed3e3ee296ef1c from: Caleb Stein date: Tue May 12 22:22:04 2026 UTC fix mail and network positioning commit - 66bd0b1c1064405df759d617cd7c068f69acd4fa commit + 2569c5975ff446cdbf528a05abed3e3ee296ef1c blob - 6ac39fd8390e60c02019037096662ff2a57c78c1 blob + ed26cfbe42a2edae15431eafee0799f80e423dcf --- include/statbar.h +++ include/statbar.h @@ -59,14 +59,14 @@ extern char **get_weather_location_ptr(void); 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 @@ -7,7 +7,7 @@ #include "statbar.h" -char mail_string[5]; +char mail_string[7]; static char *mail_path; @@ -38,7 +38,7 @@ get_mail(void) (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 @@ -10,7 +10,7 @@ #include "statbar.h" -char network_string[5]; +char network_string[7]; static char ethernet_device[IF_NAMESIZE]; static char wifi_device[IF_NAMESIZE]; @@ -62,8 +62,8 @@ read_network_socket(int fd) 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 @@ -125,8 +125,8 @@ get_initial_network_state(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 @@ -424,7 +424,7 @@ main(int argc, char *argv[]) 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,