Mailmbox: fix buffer size
authorRicardo Mones <ricardo@mones.org>
Wed, 25 Jul 2018 17:34:03 +0000 (19:34 +0200)
committerRicardo Mones <ricardo@mones.org>
Wed, 25 Jul 2018 17:34:03 +0000 (19:34 +0200)
commite025cbc3bde755867af6011a6558126a4fb183e0
tree08d0da50927ed96d4ef2a450e6153578e27d6760
parent4fe990adffb69da201234e96134b432d00f6e9cb
Mailmbox: fix buffer size

Should fix the following warnings reported on ML¹:

mailmbox.c: In function ‘claws_mailmbox_expunge_no_lock.part.4’:
mailmbox.c:1260:34: warning: ‘XXXXXX’ directive output may be truncated
writing 6 bytes into a region of size between 1 and 4096
[-Wformat-truncation=]
   snprintf(tmpfile, PATH_MAX, "%sXXXXXX", folder->mb_filename);
                                  ^~~~~~
mailmbox.c:1260:3: note: ‘snprintf’ output between 7 and 4102 bytes into
a destination of size 4096
   snprintf(tmpfile, PATH_MAX, "%sXXXXXX", folder->mb_filename);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

¹ https://lists.claws-mail.org/pipermail/users/2018-July/022270.html
src/plugins/mailmbox/mailmbox.c