Replace alloc+strcpy+strcat with asprintf() & XNFasprintf() calls

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
Alan Coopersmith 2010-11-27 23:10:46 -08:00
commit d2c42b1027
7 changed files with 20 additions and 32 deletions

View file

@ -146,11 +146,8 @@ extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
for (i = 0; extensionModules[i].name != NULL; i++) {
if (opts) {
char *s;
s = (char *)malloc(strlen(extensionModules[i].name) + 5);
if (s) {
if (Xasprinf(&s, "omit%s", extensionModules[i].name) != -1) {
pointer o;
strcpy(s, "omit");
strcat(s, extensionModules[i].name);
o = xf86FindOption(opts, s);
free(s);
if (o) {