1
0

two liner

This commit is contained in:
dtb 2023-08-29 21:43:28 -04:00
parent f2268e471a
commit d9aae297ca

View File

@ -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 *