diff --git a/src/sigar_fileinfo.c b/src/sigar_fileinfo.c index d2f9a2a2..75c4e1fe 100644 --- a/src/sigar_fileinfo.c +++ b/src/sigar_fileinfo.c @@ -589,9 +589,9 @@ int sigar_link_attrs_get(sigar_t *sigar, } } -int sigar_dir_stat_get(sigar_t *sigar, - const char *dir, - sigar_dir_stat_t *dirstats) +static int dir_stat_get(sigar_t *sigar, + const char *dir, + sigar_dir_stat_t *dirstats) { char name[SIGAR_PATH_MAX+1]; int len = strlen(dir); @@ -608,8 +608,6 @@ int sigar_dir_stat_get(sigar_t *sigar, return errno; } - SIGAR_ZERO(dirstats); - strncpy(name, dir, sizeof(name)); ptr += len; if (name[len] != '/') { @@ -677,4 +675,12 @@ int sigar_dir_stat_get(sigar_t *sigar, return SIGAR_OK; } +int sigar_dir_stat_get(sigar_t *sigar, + const char *dir, + sigar_dir_stat_t *dirstats) +{ + SIGAR_ZERO(dirstats); + return dir_stat_get(sigar, dir, dirstats); +} + #endif