[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RP] Re: PRINT_DEBUG
From: |
Bryan Ewbank |
Subject: |
[RP] Re: PRINT_DEBUG |
Date: |
Thu Nov 21 06:24:04 2002 |
> PRINT_DEBUG("Test null: '%s'", (char*) NULL);
>
> then it segfaults thusly:
>
> ratpoison:debug -- main.c:main():458: Test null: 'Segmentation
Fault
The problem is in the use of PRINT_DEBUG, not it's implementation.
It's a pass-through to printf, so g/PRINT_DEBUG/printf/ will
demonstrate the same problem.
A null pointer is not the same as a null string unless there happens
to be a zero stored in memory location zero.
Replace NULL with a null string and it will work.
- Bryan Ewbank
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
- [RP] Re: PRINT_DEBUG,
Bryan Ewbank <=