Re: [dwm] dmenu - simplification of cistrstr and kpress

From: Marc Andre Tanner <mat_AT_brain-dump.org>
Date: Thu, 26 Jun 2008 17:09:04 +0200

Premysl Hruby wrote:
>>> patch attached.
>> "return (char *)1;"?
>>
>> cistrstr(s, sub) is supposed to return a pointer to the first
>> occurence of "sub" in "s", or NULL if there is none; not some fixed
>> pointer to memory that's probably not even allocated to the process.
>>
>> Greetings, Sander.
>>
>
> Yes, that's true, but return value is only used only in comparison if is
> or isn't null, to signalize that substring is or isn't contained in the
> string.

Then change the return type to bool or int or whatever and avoid the
ugly casts.

Cheers,
Marc

-- 
  Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
Received on Thu Jun 26 2008 - 17:09:57 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:51:33 UTC