chiark / gitweb /
get pirate name right
[ypp-sc-tools.main.git] / pctb / pages.c
index ffd0ba6e4c8c9c8a39d4268291f65638030d0f87..dae3d2138bd0d8a3ae0a874b3fc8ff74ff8562f7 100644 (file)
@@ -498,17 +498,18 @@ void find_yppclient_window(void) {
        REQUIRE( !memcmp(title + len - S(suffix), suffix, S(suffix))  );
        REQUIRE( !memcmp(spc1,                    onthe,  S(onthe))  );
 
-#define ASSIGN(what, start, end) do {                                  \
-       r= asprintf(&what, "%.*s", end - start, start);  eassert(r>0);  \
+#define ASSIGN(what, start, end) do {                                   \
+       r= asprintf(&what, "%.*s", (end)-(start), start);  eassert(r>0); \
      }while(0)
-       ASSIGN(ocean,  title + S(prefix),  spc1);
-       ASSIGN(pirate, spc1 + S(onthe),   (title + len) - S(suffix));
+       ASSIGN(pirate, title + S(prefix),  spc1);
+       ASSIGN(ocean,  spc1 + S(onthe),   (title + len) - S(suffix));
 
        debugfind(" YES!\n");
        id= w2;
        nfound++;
-       progress_log("found YPP client window (0x%lx): %s on the %s ocean.",
-                    (unsigned long)id, pirate, ocean);
+       progress_log("found YPP client [--window-id 0x%lx]:"
+                    " %s ocean - %s.",
+                    (unsigned long)id, ocean, pirate);
       }
       if (children2) XFree(children2);
     }