X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=tools%2Fobxprop%2Fobxprop.c;h=83ff54a17ead35e76fb17fdc3e6b5459171339b7;hb=f866c034bf6e954791442ff029d5ae51ab0bd616;hp=2e6b2a03f7e84903ea8212e9853816f884ea9bae;hpb=4c544102c32a3b23bee23205fa0d4365ed02db09;p=chaz%2Fopenbox diff --git a/tools/obxprop/obxprop.c b/tools/obxprop/obxprop.c index 2e6b2a03..83ff54a1 100644 --- a/tools/obxprop/obxprop.c +++ b/tools/obxprop/obxprop.c @@ -28,14 +28,15 @@ gint parse_hex(gchar *s) { if (*s >= '0' && *s <='9') add = *s-'0'; else if (*s >= 'A' && *s <='F') - add = *s-'A'; + add = *s-'A'+10; else if (*s >= 'a' && *s <='f') - add = *s-'a'; + add = *s-'a'+10; else break; result *= 16; result += add; + ++s; } return result; } @@ -97,9 +98,9 @@ static gboolean get_all(Display *d, Window win, Atom prop, default: g_assert_not_reached(); /* unhandled size */ } - *num = ret_items; - ret = TRUE; } + *num = ret_items; + ret = TRUE; XFree(xdata); } return ret; @@ -253,7 +254,7 @@ void show_properties(Display *d, Window w, int argc, char **argv) } } if (found) - g_print("%s(%s) = %s\n", name, type, val); + g_print("%s(%s) = %s\n", name, type, (val ? val : "")); g_free(val); } @@ -334,9 +335,10 @@ int main(int argc, char **argv) break; } } + id = find_client(d, userid); } - - id = find_client(d, userid); + else + id = userid; /* they picked this one */ if (id == None) return fail("Unable to find window with the requested ID");