Skip to content
This repository has been archived by the owner on Jan 5, 2018. It is now read-only.

Commit

Permalink
fixed segfault when carrier is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Unia committed Apr 15, 2013
1 parent 38b8662 commit e698dad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=dwmst-git
_gitname=dwmst
pkgver=2013.04.10
pkgver=2013.04.14
pkgrel=1
pkgdesc="Hardcoded statusbar for DWM"
arch=('any')
Expand Down
7 changes: 3 additions & 4 deletions dwmst.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ int main() {
/* NET */
if (++netloops > 60) {
netloops = 0;
infile = fopen(NET_FILE, "r");
fscanf(infile, "%d\n", &net); fclose(infile);
if(net == 1)
if(fopen(NET_FILE, "r")) {
fclose(infile);
sprintf(netstring, LAN_STR);
else {
} else {
skfd = iw_sockets_open();
if (iw_get_basic_config(skfd, WLAN, &(winfo->b)) > -1) {
if (iw_get_stats(skfd, WLAN, &(winfo->stats), &winfo->range, winfo->has_range) >= 0)
Expand Down
4 changes: 2 additions & 2 deletions dwmst.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define MUSIC_P_STR "P: \x02%s " /* Music, paused */
#define MUSIC_S_STR "" /* Music, stopped */
#endif
#define SKYPE_STR "\x02Skype \x01" /*Skype is running */
#define SKYPE_STR "\x02Skype \x01" /* Skype is running */
#define NO_SKYPE_STR "" /* Skype is not running */
#define LAN_STR "Verbonden \x01" /* LAN */
#define WLAN_STR "%s \x02%d%% \x01" /* WLAN */
Expand All @@ -62,7 +62,7 @@
Display *dpy;
Window root;
FILE *infile;
int perc, hours, minutes, seconds = -1, net, skfd, mute = 0, realvol = 0, netloops = 60, musicloops = 10;
int perc, hours, minutes, seconds = -1, skfd, mute = 0, realvol = 0, netloops = 60, musicloops = 10;
long now = -1, full = -1, voltage = -1, rate = -1, vol = 0, max = 0, min = 0;
char state[8], statnext[100], status[200], netstring[30], musicstring[100];
struct wireless_info *winfo;
Expand Down

0 comments on commit e698dad

Please sign in to comment.