mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
use memcpy rather than strncpy to avoid compiler warnings
This commit is contained in:
parent
f18594ff3e
commit
379f5f0040
1 changed files with 12 additions and 12 deletions
|
@ -91,8 +91,8 @@ SetValueForKey(NSObject *self, id anObject, const char *key, unsigned size)
|
|||
char lo;
|
||||
char hi;
|
||||
|
||||
strncpy(buf, "_set", 4);
|
||||
strncpy(&buf[4], key, size);
|
||||
memcpy(buf, "_set", 4);
|
||||
memcpy(&buf[4], key, size);
|
||||
lo = buf[4];
|
||||
hi = islower(lo) ? toupper(lo) : lo;
|
||||
buf[4] = hi;
|
||||
|
@ -163,8 +163,8 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
char lo;
|
||||
char hi;
|
||||
|
||||
strncpy(buf, "_get", 4);
|
||||
strncpy(&buf[4], key, size);
|
||||
memcpy(buf, "_get", 4);
|
||||
memcpy(&buf[4], key, size);
|
||||
buf[size + 4] = '\0';
|
||||
lo = buf[4];
|
||||
hi = islower(lo) ? toupper(lo) : lo;
|
||||
|
@ -474,12 +474,12 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
SEL sel;
|
||||
BOOL (*imp)(id,SEL,id*,id*);
|
||||
|
||||
strncpy(name, "validate", 8);
|
||||
memcpy(name, "validate", 8);
|
||||
[aKey getCString: &name[8]
|
||||
maxLength: size + 1
|
||||
encoding: NSUTF8StringEncoding];
|
||||
size = strlen(&name[8]);
|
||||
strncpy(&name[size + 8], ":error:", 7);
|
||||
memcpy(&name[size + 8], ":error:", 7);
|
||||
name[size + 15] = '\0';
|
||||
if (islower(name[8]))
|
||||
{
|
||||
|
@ -611,12 +611,12 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
char lo;
|
||||
char hi;
|
||||
|
||||
strncpy(buf, "_get", 4);
|
||||
memcpy(buf, "_get", 4);
|
||||
[aKey getCString: key
|
||||
maxLength: size + 1
|
||||
encoding: NSUTF8StringEncoding];
|
||||
size = strlen(key);
|
||||
strncpy(&buf[4], key, size);
|
||||
memcpy(&buf[4], key, size);
|
||||
buf[size + 4] = '\0';
|
||||
lo = buf[4];
|
||||
hi = islower(lo) ? toupper(lo) : lo;
|
||||
|
@ -696,12 +696,12 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
char lo;
|
||||
char hi;
|
||||
|
||||
strncpy(buf, "_set", 4);
|
||||
memcpy(buf, "_set", 4);
|
||||
[aKey getCString: key
|
||||
maxLength: size + 1
|
||||
encoding: NSUTF8StringEncoding];
|
||||
size = strlen(key);
|
||||
strncpy(&buf[4], key, size);
|
||||
memcpy(&buf[4], key, size);
|
||||
buf[size + 4] = '\0';
|
||||
lo = buf[4];
|
||||
hi = islower(lo) ? toupper(lo) : lo;
|
||||
|
@ -819,8 +819,8 @@ static id ValueForKey(NSObject *self, const char *key, unsigned size)
|
|||
char lo;
|
||||
char hi;
|
||||
|
||||
strncpy(buf, "_set", 4);
|
||||
strncpy(&buf[4], key, size);
|
||||
memcpy(buf, "_set", 4);
|
||||
memcpy(&buf[4], key, size);
|
||||
lo = buf[4];
|
||||
hi = islower(lo) ? toupper(lo) : lo;
|
||||
buf[4] = hi;
|
||||
|
|
Loading…
Reference in a new issue