Date: 04/30/98
- Next message: C. R. Oldham: "[PHP-DEV] PHP 3.0RC4: Cannot load as dynamic module, Apache 1.3b6, Solaris 2.5.1x86"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] Re: Bug #262 Updated: dbminsert() failure / db.c flaws"
- In reply to: Ralf Pradella: "[PHP-DEV] Re: Bug #262 Updated: dbminsert() failure / db.c flaws"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 14:13 30/04/98 +0200, Ralf Pradella wrote:
>You e.g. #define DBM_WRITE_MODE "w+b"
>and then seem to use DBM_WRITE_MODE as a regular variable which it isn't.
>The result of e.g.
>
>#define STR "blabla"
>puts(strcmp(STR, STR) ? "Not really so equal..." : "Lucky you!");
>
>is not predictable. Such coding is bad and will ever be so. Sorry if I
>appear arrogant but you shouldn't do this.
By the way, I just looked at db.c, and there's nothing wrong there.
DBM_WRITE_MODE evaluates to a string constant, that points to a static
location in memory (a good compiler will make all occurences point to the
same location in memory, but that's not necessary, nor is it important in
this case). You can assign it to a char * pointer, and use it (read only)
as much as you'd like. It's fine and it's fine coding too.
Zeev
-- Zeev Suraski <zeev <email protected>> For a PGP public key, finger bourbon <email protected>
- Next message: C. R. Oldham: "[PHP-DEV] PHP 3.0RC4: Cannot load as dynamic module, Apache 1.3b6, Solaris 2.5.1x86"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] Re: Bug #262 Updated: dbminsert() failure / db.c flaws"
- In reply to: Ralf Pradella: "[PHP-DEV] Re: Bug #262 Updated: dbminsert() failure / db.c flaws"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

