From: Ian Jackson Date: Sun, 7 Jun 2009 15:51:12 +0000 (+0100) Subject: get pirate name right X-Git-Tag: 1.9.2~152 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=4d7eb93b7c82da31f928349ac7c6cd551d78ca57;hp=09e8b6a8735c8cd1f7f3ffbabc1a05f0a8f8ca75 get pirate name right --- diff --git a/pctb/pages.c b/pctb/pages.c index ffd0ba6..dae3d21 100644 --- a/pctb/pages.c +++ b/pctb/pages.c @@ -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); } diff --git a/pctb/x.gdb b/pctb/x.gdb index 5d5abeb..95c9b11 100644 --- a/pctb/x.gdb +++ b/pctb/x.gdb @@ -2,5 +2,5 @@ file convert set confirm off set args --screenshot-only -break pages.c:375 +break pages.c:510 run