Minor warning/error cleanup

This commit is contained in:
Todd C. Miller
2011-05-18 13:44:36 -04:00
parent 0954a1b1c0
commit 42a3966a88
7 changed files with 14 additions and 13 deletions

View File

@@ -42,6 +42,7 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#include <errno.h>
#include "sudoers.h"
@@ -64,7 +65,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
int len; /* length parameter */
if (strlen(infile) >= PATH_MAX)
errorx(1, _("%s: File name too long"), infile);
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
/*
* If we were given a fully qualified or relative path
@@ -103,7 +104,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
*/
len = snprintf(command, sizeof(command), "%s/%s", path, infile);
if (len <= 0 || len >= sizeof(command))
errorx(1, _("%s: File name too long"), infile);
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
if ((result = sudo_goodpath(command, sbp)))
break;
@@ -118,7 +119,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
if (!result && checkdot) {
len = snprintf(command, sizeof(command), "./%s", infile);
if (len <= 0 || len >= sizeof(command))
errorx(1, _("%s: File name too long"), infile);
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
result = sudo_goodpath(command, sbp);
if (result && ignore_dot)
return NOT_FOUND_DOT;