src/: Use xasprintf() instead of its pattern

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-05-13 14:37:14 +02:00
committed by Serge Hallyn
parent 44ba094766
commit d9923431eb
4 changed files with 10 additions and 15 deletions
+2 -3
View File
@@ -21,6 +21,7 @@
#include "prototypes.h"
#include "defines.h"
#include "getdef.h"
#include "string/sprintf/xasprintf.h"
#if WITH_LIBBSD == 0
#include "freezero.h"
@@ -99,9 +100,7 @@ static /*@observer@*//*@null@*/const char *password_check (
newmono = str_lower (xstrdup (new));
oldmono = str_lower (xstrdup (old));
wrapped = XMALLOC(strlen(oldmono) * 2 + 1, char);
strcpy (wrapped, oldmono);
strcat (wrapped, oldmono);
xasprintf(&wrapped, "%s%s", oldmono, oldmono);
if (palindrome (oldmono, newmono)) {
msg = _("a palindrome");