D24489: KAutosaveFile not respecting maximum filename length

Ahmad Samir noreply at phabricator.kde.org
Sun Dec 1 16:54:50 GMT 2019


ahmadsamir added a comment.


  IIUC, FILENAME_MAX corresponds to PATH_MAX, 4096 (bytes; or chars in an array).
  
  NAME_MAX is the max. filename (the filename part only, without the canonical path) length, this is 255 on Linux.
  
  So using FILENAME_MAX is correct in the code.
  
  See:
  https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html , which talks about FILENAME_MAX, NAME_MAX and PATH_MAX .... \o/
  /usr/include/stdio.h (from glibc-devel)
  /usr/include/bits/stdio_lim.h
  
  And:
  /usr/include/linux/limits.h:
  #define NAME_MAX         255	/* # chars in a file name */
  #define PATH_MAX        4096	/* # chars in a path name including nul */

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D24489

To: mardelle, #frameworks, dfaure
Cc: ahmadsamir, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191201/c9456506/attachment.html>


More information about the Kde-frameworks-devel mailing list