[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: Very interesting thing happend while creating a menu item...
From: |
Jürgen Pfeifer |
Subject: |
AW: Very interesting thing happend while creating a menu item... |
Date: |
Sat, 1 Mar 2003 13:55:13 +0100 |
Yes. This is the relevant part from the source code that hopefully makes very
clear what happens:
static bool Is_Printable_String(const char *s)
{
assert(s);
while(*s)
{
if (!isprint((unsigned char)*s))
return FALSE;
s++;
}
return TRUE;
}
NCURSES_EXPORT(ITEM *)
new_item (const char *name, const char *description)
{
ITEM *item;
if ( !name || (*name == '\0') || !Is_Printable_String(name) )
{
item = (ITEM *)0;
SET_ERROR( E_BAD_ARGUMENT );
}
...
-----Ursprüngliche Nachricht-----
Von: jon wackley [mailto:address@hidden
Gesendet: Thursday, February 27, 2003 3:12 AM
An: Jürgen Pfeifer; address@hidden
Cc: address@hidden
Betreff: RE: Very interesting thing happend while creating a menu item...
Thanks for the clarification Jurgen. Just to be clear, if the string to
new_item contains any non-printable characters then the call will fail? The
location of the ESC char in the string is irrelevant.
Thanks,
jonw
> -----Original Message-----
> From: Jürgen Pfeifer [mailto:address@hidden
> Sent: February 26, 2003 7:18 PM
> To: jon wackley; address@hidden
> Cc: address@hidden
> Subject: RE: Very interesting thing happend while creating a menu
> item...
>
>
> This is not a bug, it is intended behaviour.
> Non-Printable strings as menu labels are simply not allowed.
> If you do a check for null on the new_item() call and if null
> evaluate errno you would see that you got an E_BAD_ARGUMENT.
>
> Cheers
> Jürgen
>
> > > On Wed, Feb 26, 2003 at 12:48:12PM -0500, jon wackley wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Just a curiousity, is this a bug, or a case of improper api use?
> > >
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- AW: Very interesting thing happend while creating a menu item...,
Jürgen Pfeifer <=