X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=753bbf039a21153f5f5ee8a837ea986e39140666;hb=ebb72d68f2e0cf5f5d921f98f7c2f0f9e118ae6f;hp=4c5974b84d3c9ff6e48cc5e3128c5a854ff84603;hpb=859eaac28f40b3bfe5544c7ee16e5054dd2e5f53;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 4c5974b..753bbf0 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -701,7 +701,7 @@ void update_window(struct ws_win *); char * expand_tilde(char *s) { - struct passwd *pwd; + struct passwd *ppwd; int i, max; char *user; const char *sc = s; @@ -728,11 +728,11 @@ expand_tilde(char *s) user[i] = '\0'; s = &s[i]; - pwd = strlen(user) == 0 ? getpwuid(getuid()) : getpwnam(user); - if (pwd == NULL) + ppwd = strlen(user) == 0 ? getpwuid(getuid()) : getpwnam(user); + if (ppwd == NULL) result = strdup(sc); else - if (asprintf(&result, "%s%s", pwd->pw_dir, s) == -1) + if (asprintf(&result, "%s%s", ppwd->pw_dir, s) == -1) result = NULL; out: if (result == NULL) @@ -5780,7 +5780,7 @@ setconfquirk(char *selector, char *value, int flags) { char *cp, *class, *name; int retval; - unsigned long quirks; + unsigned long qrks; /* suppress unused warning since var is needed */ (void)flags; @@ -5792,8 +5792,8 @@ setconfquirk(char *selector, char *value, int flags) *cp = '\0'; class = selector; name = cp + 1; - if ((retval = parsequirks(value, &quirks)) == 0) - setquirk(class, name, quirks); + if ((retval = parsequirks(value, &qrks)) == 0) + setquirk(class, name, qrks); return (retval); } @@ -7410,10 +7410,10 @@ clientmessage(xcb_client_message_event_t *e) void check_conn(void) { - int err = xcb_connection_has_error(conn); + int errcode = xcb_connection_has_error(conn); char *s; - - switch (err) { +#ifdef XCB_CONN_ERROR + switch (errcode) { case XCB_CONN_ERROR: s = "Socket error, pipe error or other stream error."; break; @@ -7432,9 +7432,12 @@ check_conn(void) default: s = "Unknown error."; } - - if (err) - errx(err, "X CONNECTION ERROR: %s", s); + if (errcode) + errx(errcode, "X CONNECTION ERROR: %s", s); +#else + if (errcode) + errx(errcode, "X CONNECTION ERROR"); +#endif } int