Package: db4.6-doc
Version: 4.6.19-1

In the examples of opening a transactional database in
/usr/share/doc/db4.6-doc/gsg_txn/C/envopen.html we twice have the
example code:

[...]
    if (ret != 0) {
        fprintf(stderr, "Error opening environment: %s\n",
            db_strerror(ret));
        goto err;
    }

err:
    /* Close the environment */
    if (envp != NULL) {
[...]

    return (ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE);

This code is very misleading, as "return EXIT_SUCCESS;" should appear
before the err: label, and "return EXIT_FAILURE;" should appear at the
end.  I spent a long while tracking down this one after making use of
the sample code.

   Julian



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to