Removed xalloc type functions from library

These xalloc functions are a private function for the library. If using
programs need them, then they should make their own error reporting or
use a common file.
This commit is contained in:
Craig Small
2011-12-20 22:56:17 +11:00
parent 562b4a039f
commit 2865ded64e
6 changed files with 41 additions and 46 deletions

View File

@@ -23,7 +23,6 @@
#include "common.h"
#include <sys/sysmacros.h>
#include "../proc/alloc.h"
#include "../proc/wchan.h"
#include "../proc/version.h"
#include "../proc/sysinfo.h"
@@ -234,7 +233,10 @@ static const char *set_personality(void){
if(sl > 15) return "Environment specified an unknown personality.";
strncpy(buf, s, sl);
buf[sl] = '\0';
saved_personality_text = xstrdup(buf);
if ((saved_personality_text = strdup(buf))==NULL) {
fprintf(stderr, "Cannot strdup() personality text.\n");
exit(EXIT_FAILURE);
}
found = bsearch(&findme, personality_table, personality_table_count,
sizeof(personality_table_struct), compare_personality_table_structs