mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
fix escaped encoding to be ascii
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f6925ca1c9
commit
dd3fface17
1 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ randombytes(uint8_t *buf, unsigned len)
|
|||
else if ('\r' == b) size++;
|
||||
else if ('\t' == b) size++;
|
||||
else if ('\\' == b) size++;
|
||||
else if (!isprint(b)) size += 3;
|
||||
else if (b < 32 || b > 126) size += 3;
|
||||
}
|
||||
buf = (uint8_t*)malloc(size);
|
||||
for (pos = index = 0; index < count; index++)
|
||||
|
@ -174,7 +174,7 @@ randombytes(uint8_t *buf, unsigned len)
|
|||
buf[pos++] = '\\';
|
||||
buf[pos++] = '\\';
|
||||
}
|
||||
else if (!isprint(b))
|
||||
else if (b < 32 || b > 126)
|
||||
{
|
||||
sprintf((char*)&buf[pos], "\\x%02x", b);
|
||||
pos += 4;
|
||||
|
|
Loading…
Reference in a new issue