mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
([NSString -description]): Fix warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1539 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ac34a1cc86
commit
169cb14712
1 changed files with 9 additions and 7 deletions
|
@ -650,14 +650,16 @@ handle_printf_atsign (FILE *stream,
|
||||||
#define charesc(ch) (inrange(ch,07,014) || ((ch)=='\"') || ((ch)=='\\'))
|
#define charesc(ch) (inrange(ch,07,014) || ((ch)=='\"') || ((ch)=='\\'))
|
||||||
#define numesc(ch) (((ch)<=06) || inrange(ch,015,037) || ((ch)>0176))
|
#define numesc(ch) (((ch)<=06) || inrange(ch,015,037) || ((ch)>0176))
|
||||||
|
|
||||||
for(src_ptr=(char *)src,len=0,quote=0; ch=*src_ptr; src_ptr++,len++)
|
for (src_ptr = (char*)src, len=0,quote=0;
|
||||||
|
(ch=*src_ptr);
|
||||||
|
src_ptr++, len++)
|
||||||
{
|
{
|
||||||
if(!noquote(ch))
|
if (!noquote(ch))
|
||||||
{
|
{
|
||||||
quote=1;
|
quote=1;
|
||||||
if(charesc(ch))
|
if (charesc(ch))
|
||||||
len++;
|
len++;
|
||||||
else if(numesc(ch))
|
else if (numesc(ch))
|
||||||
len+=3;
|
len+=3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -670,12 +672,12 @@ handle_printf_atsign (FILE *stream,
|
||||||
dest_ptr = dest;
|
dest_ptr = dest;
|
||||||
if (quote)
|
if (quote)
|
||||||
*(dest_ptr++) = '\"';
|
*(dest_ptr++) = '\"';
|
||||||
for(; ch=*src_ptr; src_ptr++,dest_ptr++)
|
for (; (ch=*src_ptr); src_ptr++,dest_ptr++)
|
||||||
{
|
{
|
||||||
if(charesc(ch))
|
if (charesc(ch))
|
||||||
{
|
{
|
||||||
*(dest_ptr++) = '\\';
|
*(dest_ptr++) = '\\';
|
||||||
switch(ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case '\a': *dest_ptr = 'a'; break;
|
case '\a': *dest_ptr = 'a'; break;
|
||||||
case '\b': *dest_ptr = 'b'; break;
|
case '\b': *dest_ptr = 'b'; break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue