2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Add ssizeof macro that returns ssize_t.

We can use this instead of casting the result of size_t to int.
Also change checks for snprintf() returning <=0 to <0.
This commit is contained in:
Todd C. Miller
2019-06-25 09:45:10 -06:00
parent 81602ad086
commit 9d8f374397
17 changed files with 31 additions and 28 deletions

View File

@@ -88,7 +88,7 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
len = snprintf(fullpath, pathsize, "%s%s", sudo_conf_plugin_dir_path(),
info->path);
if (len <= 0 || (size_t)len >= pathsize) {
if (len < 0 || (size_t)len >= pathsize) {
sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
_PATH_SUDO_CONF, info->lineno, info->symbol_name);
sudo_warnx(U_("%s%s: %s"), sudo_conf_plugin_dir_path(), info->path,