Xfennec / progress

Linux tool to show progress for cp, mv, dd, ... (formerly known as cv)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compiler warnings

requiredregistration opened this issue · comments

gcc 10.1.0

progress.c:230:47: warning: ‘/exe’ directive output may be truncated writing 4 bytes into a region of size between 0 and 4096 [-Wformat-truncation=]
  230 |         snprintf(fullpath_exe, MAXPATHLEN, "%s/exe", fullpath_dir);
      |                                               ^~~~
progress.c:230:9: note: ‘snprintf’ output between 5 and 4101 bytes into a destination of size 4096
  230 |         snprintf(fullpath_exe, MAXPATHLEN, "%s/exe", fullpath_dir);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
progress.c: In function ‘find_fd_for_pid’:
progress.c:319:39: warning: ‘/’ directive output may be truncated writing 1 byte into a region of size between 0 and 4096 [-Wformat-truncation=]
  319 |     snprintf(fullpath, MAXPATHLEN, "%s/%s", path_dir, direntp->d_name);
      |                                       ^
progress.c:319:5: note: ‘snprintf’ output between 2 and 4353 bytes into a destination of size 4096
  319 |     snprintf(fullpath, MAXPATHLEN, "%s/%s", path_dir, direntp->d_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixed in 0.15, thanks for reporting.