mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-23 10:35:50 +01:00
WUtil: remove unnecessary check in wstrappend (Coverity #50138)
The function wrealloc never fails, and allocates enough storage to store the resulting string, so it is useless to check if strcat failed. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
05f88d0aa7
commit
5255c364b8
@@ -235,8 +235,7 @@ char *wstrappend(char *dst, const char *src)
|
|||||||
|
|
||||||
slen = strlen(dst) + strlen(src) + 1;
|
slen = strlen(dst) + strlen(src) + 1;
|
||||||
dst = wrealloc(dst, slen);
|
dst = wrealloc(dst, slen);
|
||||||
if (wstrlcat(dst, src, slen) >= slen)
|
strcat(dst, src);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user