[Pkg-db-devel] Bug#449184: db4.6-doc: broken examples

Julian Gilbey jdg at debian.org
Sat Nov 3 22:10:09 UTC 2007


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





More information about the Pkg-db-devel mailing list