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