mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
more bsd tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32485 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dbaa646d12
commit
dbf4119553
19 changed files with 91 additions and 68 deletions
|
@ -4340,7 +4340,7 @@ static BOOL warned = NO; if (warned == NO) { warned = YES; NSLog(@"WARNING, use
|
|||
|
||||
to[j++] = '&';
|
||||
to[j++] = '#';
|
||||
sprintf(buf, "%u", c);
|
||||
snprintf(buf, sizeof(buf), "%u", c);
|
||||
while (*ptr != '\0')
|
||||
{
|
||||
to[j++] = *ptr++;
|
||||
|
|
|
@ -629,7 +629,7 @@ static void MD5Transform (uint32_t buf[4], uint32_t const in[16])
|
|||
/*
|
||||
* The header is a line of the form 'begin mode filename'
|
||||
*/
|
||||
sprintf((char*)buf, "begin %03o ", (int)mode);
|
||||
snprintf((char*)buf, sizeof(buf), "begin %03o ", (int)mode);
|
||||
[encoded appendBytes: buf length: strlen((const char*)buf)];
|
||||
[encoded appendData: [name dataUsingEncoding: NSASCIIStringEncoding]];
|
||||
[encoded appendBytes: "\n" length: 1];
|
||||
|
|
|
@ -137,7 +137,7 @@ strerror_r(int eno, char *buf, int len)
|
|||
domain = NSPOSIXErrorDomain;
|
||||
if (strerror_r(code, buf, BUFSIZ) < 0)
|
||||
{
|
||||
sprintf(buf, "%ld", code);
|
||||
snprintf(buf, sizeof(buf), "%ld", code);
|
||||
}
|
||||
message = [NSString stringWithCString: buf
|
||||
encoding: [NSString defaultCStringEncoding]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue