From: Damir Tomic Date: Wed, 19 Aug 2015 23:10:57 +0000 (+0200) Subject: Makefile.am: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=373cc3bb1405100659bc1b8495c3819a4b10bbcb;p=thirdparty%2Fntp.git Makefile.am: added 2 more temp files to CLEANFILES and DISTCLEAN, because it prevented make distcheck from finishing properly pathfind.c: reverted emalloc to malloc with if(result == NULL)... because sntp/ doesn't link libntp...probably for a reason unknown to me. bk: 55d50d012hi-Qnhn_CyLn4HcpbdcdQ --- diff --git a/sntp/libopts/compat/pathfind.c b/sntp/libopts/compat/pathfind.c index 5890ec62f..d343dcc64 100644 --- a/sntp/libopts/compat/pathfind.c +++ b/sntp/libopts/compat/pathfind.c @@ -19,7 +19,7 @@ pathfind( char const * path, char const * fname, char const * mode ) { - return estrdup(fname); + return strdup(fname); } #else @@ -114,10 +114,16 @@ make_absolute( char const * string, char const * dot_path ) int result_len; if (!dot_path || *string == '/') { - result = estrdup( string ); + result = strdup( string ); + if (result == NULL) { + return NULL; /* couldn't allocate memory */ + } } else { if (dot_path && dot_path[0]) { - result = emalloc( 2 + strlen( dot_path ) + strlen( string ) ); + result = malloc( 2 + strlen( dot_path ) + strlen( string ) ); + if (result == NULL) { + return NULL; /* couldn't allocate memory */ + } strcpy( result, dot_path ); result_len = (int)strlen(result); if (result[result_len - 1] != '/') { @@ -125,7 +131,10 @@ make_absolute( char const * string, char const * dot_path ) result[result_len] = '\0'; } } else { - result = emalloc( 3 + strlen( string ) ); + result = malloc( 3 + strlen( string ) ); + if (result == NULL) { + return NULL; /* couldn't allocate memory */ + } result[0] = '.'; result[1] = '/'; result[2] = '\0'; result_len = 2; } @@ -154,8 +163,10 @@ canonicalize_pathname( char *path ) char stub_char, *result; /* The result cannot be larger than the input PATH. */ - result = estrdup( path ); - + result = strdup( path ); + if (result == NULL) { + return NULL; /* couldn't allocate memory */ + } stub_char = (*path == '/') ? '/' : '.'; /* Walk along RESULT looking for things to compact. */ diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index c481aee8e..8a5c09f03 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -9,12 +9,16 @@ CLEANFILES = \ kod-output-blank \ kod-output-multiple \ kod-output-single \ + testLogfile.log \ + testLogfile2.log \ $(NULL) DISTCLEANFILES = \ kod-output-blank \ kod-output-single \ kod-output-multiple \ + testLogfile.log \ + testLogfile2.log \ $(NULL) std_unity_list = \