src/: Use xasprintf() instead of its pattern
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
44ba094766
commit
d9923431eb
+2
-3
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user