@@ -672,7 +672,7 @@ const char *suggest_doc_links(const char *progname, const char *progconf) {
672672 size_t i ;
673673
674674 for (i = 0 ; buf2 [i ]; i ++ ) {
675- buf2 [i ] = tolower (buf2 [i ]);
675+ buf2 [i ] = tolower (( unsigned char )( buf2 [i ]) );
676676 }
677677
678678 if ((s = strstr (buf2 , ".exe" )) && strcmp (buf2 , "nut.exe" ))
@@ -1012,7 +1012,7 @@ char * getprocname(pid_t pid)
10121012 */
10131013 char * procname = NULL ;
10141014 size_t procnamelen = 0 ;
1015- char pathname [NUT_PATH_MAX ];
1015+ char pathname [NUT_PATH_MAX + 1 ];
10161016 struct stat st ;
10171017
10181018#ifdef WIN32
@@ -1469,7 +1469,7 @@ int compareprocname(pid_t pid, const char *procname, const char *progname)
14691469 size_t procbasenamelen = 0 , progbasenamelen = 0 ;
14701470 /* Track where the last dot is in the basename; 0 means none */
14711471 size_t procbasenamedot = 0 , progbasenamedot = 0 ;
1472- char procbasename [NUT_PATH_MAX ], progbasename [NUT_PATH_MAX ];
1472+ char procbasename [NUT_PATH_MAX + 1 ], progbasename [NUT_PATH_MAX + 1 ];
14731473
14741474 if (checkprocname_ignored (__func__ )) {
14751475 ret = -3 ;
@@ -1661,7 +1661,7 @@ int checkprocname(pid_t pid, const char *progname)
16611661 depending on the .exe path */
16621662char * getfullpath (char * relative_path )
16631663{
1664- char buf [NUT_PATH_MAX ];
1664+ char buf [NUT_PATH_MAX + 1 ];
16651665 if ( GetModuleFileName (NULL , buf , sizeof (buf )) == 0 ) {
16661666 return NULL ;
16671667 }
@@ -1682,7 +1682,7 @@ char * getfullpath(char * relative_path)
16821682void writepid (const char * name )
16831683{
16841684#ifndef WIN32
1685- char fn [NUT_PATH_MAX ];
1685+ char fn [NUT_PATH_MAX + 1 ];
16861686 FILE * pidf ;
16871687 mode_t mask ;
16881688
@@ -2217,7 +2217,7 @@ int str_add_unique_token(char *tgt, size_t tgtsize, const char *token,
22172217#ifndef WIN32
22182218int sendsignal (const char * progname , int sig , int check_current_progname )
22192219{
2220- char fn [NUT_PATH_MAX ];
2220+ char fn [NUT_PATH_MAX + 1 ];
22212221
22222222 snprintf (fn , sizeof (fn ), "%s/%s.pid" , rootpidpath (), progname );
22232223
@@ -3236,7 +3236,7 @@ const char * rootpidpath(void)
32363236/* Die with a standard message if socket filename is too long */
32373237void check_unix_socket_filename (const char * fn ) {
32383238 size_t len = strlen (fn );
3239- size_t max = NUT_PATH_MAX ;
3239+ size_t max = NUT_PATH_MAX ; /* no +1 here */
32403240#ifndef WIN32
32413241 struct sockaddr_un ssaddr ;
32423242 max = sizeof (ssaddr .sun_path );
@@ -4036,7 +4036,7 @@ static char * get_libname_in_dir(const char* base_libname, size_t base_libname_l
40364036 DIR * dp ;
40374037 struct dirent * dirp ;
40384038 char * libname_path = NULL , * libname_alias = NULL ;
4039- char current_test_path [NUT_PATH_MAX ];
4039+ char current_test_path [NUT_PATH_MAX + 1 ];
40404040
40414041 upsdebugx (3 , "%s('%s', %" PRIuSIZE ", '%s', %i): Entering method..." ,
40424042 __func__ , base_libname , base_libname_length , dirname , index );
0 commit comments