summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-08 18:36:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-08 18:36:54 +0000
commitfcc21f73c1b7cda850eae13c036c677c9a68f385 (patch)
tree7ce4444fb7ac9d6f0e1965a0e3742faaa61df3db
parent864e910166805954dfbfac1980911074efd0d005 (diff)
use asprintf; ok henning
-rw-r--r--usr.sbin/httpd/src/os/unix/os.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/httpd/src/os/unix/os.c b/usr.sbin/httpd/src/os/unix/os.c
index 3ee29642c49..341c9ae7c94 100644
--- a/usr.sbin/httpd/src/os/unix/os.c
+++ b/usr.sbin/httpd/src/os/unix/os.c
@@ -159,16 +159,15 @@ void *ap_os_dso_sym(void *handle, const char *symname)
#elif defined(HAVE_DYLD)
NSSymbol symbol;
- char *symname2 = (char*)malloc(sizeof(char)*(strlen(symname)+2));
- sprintf(symname2, "_%s", symname);
+ asprintf(&symname2, "_%s", symname);
symbol = NSLookupAndBindSymbol(symname2);
free(symname2);
return NSAddressOfSymbol(symbol);
#elif defined(DLSYM_NEEDS_UNDERSCORE)
- char *symbol = (char*)malloc(sizeof(char)*(strlen(symname)+2));
+ char *symbol;
void *retval;
- sprintf(symbol, "_%s", symname);
+ asprintf(&symbol, "_%s", symname);
retval = dlsym(handle, symbol);
free(symbol);
return retval;