two liner
This commit is contained in:
parent
f2268e471a
commit
d9aae297ca
@ -35,10 +35,11 @@ char *
|
||||
FatStr_convert(struct FatStr *p){
|
||||
char *r;
|
||||
|
||||
if((r = malloc(p->s * (sizeof *(p->v)))) == NULL) /* might be buggy */
|
||||
return NULL;
|
||||
strncpy(r, p->v, p->s);
|
||||
return r;
|
||||
/* allocation might be wrong */
|
||||
return ((r = malloc(p->s * (sizeof *(p->v)))) == NULL)
|
||||
? NULL
|
||||
: strncpy(r, p->v, p->s)
|
||||
;
|
||||
}
|
||||
|
||||
struct FatStr *
|
||||
|
Loading…
Reference in New Issue
Block a user