summaryrefslogtreecommitdiffstats
path: root/mkdtemp.c
AgeCommit message (Collapse)Author
2019-01-05Fix mkdtemp() random signednessEike Rathke
time_t return of time() may be signed 32-bit and in that case probably will roll over in the year 2038 and yield a negative value; signedness was propagated in the XOR operation to the 'value' and then 'v' variables. The 'v % 62' operation then would had resulted in a negative value and LETTER[v%62] would had accessed an arbitrary data location. The same could had happened if the static long 'value' variable after a very long run time contained a sufficiently large value to which the time^pid value added resulted in a wrap / roll-over to a negative value. Using unsigned long types for 'value' and 'v' and casting time_t to unsigned long cures all this.
2019-01-04Clean up code indentation.Kevin McCarthy
These are mostly automated changes corresponding to the emacs settings: (c-set-style "linux") (setq c-basic-offset 2) (c-set-offset 'case-label '+) Most of the code follows the convention: (add-to-list 'c-cleanup-list 'space-before-funcall) but this is not enforced by this indentation cleanup. Also, I personally dislike tabs, so I have: (setq-default indent-tabs-mode nil) in my own configuration. However I have no desire to change every line just for that effect. So this cleanup does nothing about the mix issue. Some of the secondary files (e.g. regex.c) have been skipped. I've also skipped crypt-gpgme.c, because I need to think about that file. Werner Koch and the GnuPG team contributed most it, and it follows the Gnu indentation settings. It should probably be made uniform with Mutt, but I don't want to discourage future GnuPG contribution to the file. I manually reverted a few unsightly cleanups, and added a few tweeks when I saw things that could be improved.
2019-01-04Fix mkdtemp.c implementation.Kevin McCarthy
Two statements were indented on the same line under a for statement. The second one would not be included in the loop, only being executed after the loop finishes. This is obviously an error, as it modifies the LETTERS entry being used.
2013-07-23fix typos in commentsOndřej Bílka
2009-04-25Add mkdtemp() from xfce to unbreak gpgme build on Solaris. Closes #3217.Thomas Wiegner