]> Dogcows Code - chaz/openbox/blobdiff - tools/obxprop/obxprop.c
Updated Italian translation
[chaz/openbox] / tools / obxprop / obxprop.c
index 2e6b2a03f7e84903ea8212e9853816f884ea9bae..83ff54a17ead35e76fb17fdc3e6b5459171339b7 100644 (file)
@@ -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");
This page took 0.020962 seconds and 4 git commands to generate.