Bug 90231 - Missing string end in xcb-requests man page
Summary: Missing string end in xcb-requests man page
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Docs (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-29 11:58 UTC by Stefan M
Modified: 2015-05-05 11:37 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Stefan M 2015-04-29 11:58:55 UTC
Hi,

the xcb-requests man page is missing the string end double-quote in the printf() line in the COOKIES section:

void my_example(xcb_connection *conn) {
    xcb_intern_atom_cookie_t cookie;
    xcb_intern_atom_reply_t *reply;

    cookie = xcb_intern_atom(conn, 0, strlen("_NET_WM_NAME"),
                             "_NET_WM_NAME");
    /⁠* ... do other work here if possible ... */⁠
    if ((reply = xcb_intern_atom_reply(conn, cookie, NULL))) {
 printf("The _NET_WM_NAME atom has ID %u0, reply-⁠>atom); /⁠/⁠ <====
    }
    free(reply);
}

Needed change would be:

-  printf("The _NET_WM_NAME atom has ID %u0, reply-⁠>atom);
+  printf("The _NET_WM_NAME atom has ID %u0", reply-⁠>atom);

Kind regards,
Stefan
Comment 1 Alan Coopersmith 2015-04-30 06:20:15 UTC
The string is correct in the man page sources:

        printf("The _NET_WM_NAME atom has ID %u\n", reply->atom);

but \n is an nroff command to "Interpolates number register x" (where x is
the character following the \n sequence), thus the replacement of \n" with 0.

We need to instead use the nroff escape sequence \e to print \ there.
Comment 2 Alan Coopersmith 2015-04-30 06:22:13 UTC
Actually, it looks like \\n is enough, and is used in other statements in
that man page already.
Comment 3 Alan Coopersmith 2015-04-30 06:26:52 UTC
Patch submitted for review: http://patchwork.freedesktop.org/patch/48313/
Comment 4 Alan Coopersmith 2015-05-05 04:14:09 UTC
Fix pushed To ssh://git.freedesktop.org/git/xcb/libxcb
   a90be99..c49aa98  master -> master
Comment 5 Stefan M 2015-05-05 11:37:38 UTC
Thank you Alan


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.