Fossil SCM

Enlarge the static buffer in fossil_expand_datetime() by one byte so that a compact date with a trailing Z, when rounded up, no longer writes its terminating zero past the end.

dmestas 2026-11-21 15:05 UTC small-fixes
Commit 19f1544e2b760ebdb2a4b9f6bb3ed072540fb3167b93ca6a5d291b49fe33a698
1 file changed +1 -1
+1 -1
--- src/name.c
+++ src/name.c
@@ -78,11 +78,11 @@
7878
** the input string is a hash prefix and NULL is returned if it is. If the
7979
** bVerifyNotAHash flag is false, then the result is determined by syntax
8080
** of the input string only, without reference to the artifact table.
8181
*/
8282
char *fossil_expand_datetime(const char *zIn,int bVerifyNotAHash,int bRoundUp){
83
- static char zEDate[24];
83
+ static char zEDate[25];
8484
static const char aPunct[] = { 0, 0, '-', '-', ' ', ':', ':' };
8585
int n = (int)strlen(zIn);
8686
int i, j;
8787
int addZulu = 0;
8888
8989
--- src/name.c
+++ src/name.c
@@ -78,11 +78,11 @@
78 ** the input string is a hash prefix and NULL is returned if it is. If the
79 ** bVerifyNotAHash flag is false, then the result is determined by syntax
80 ** of the input string only, without reference to the artifact table.
81 */
82 char *fossil_expand_datetime(const char *zIn,int bVerifyNotAHash,int bRoundUp){
83 static char zEDate[24];
84 static const char aPunct[] = { 0, 0, '-', '-', ' ', ':', ':' };
85 int n = (int)strlen(zIn);
86 int i, j;
87 int addZulu = 0;
88
89
--- src/name.c
+++ src/name.c
@@ -78,11 +78,11 @@
78 ** the input string is a hash prefix and NULL is returned if it is. If the
79 ** bVerifyNotAHash flag is false, then the result is determined by syntax
80 ** of the input string only, without reference to the artifact table.
81 */
82 char *fossil_expand_datetime(const char *zIn,int bVerifyNotAHash,int bRoundUp){
83 static char zEDate[25];
84 static const char aPunct[] = { 0, 0, '-', '-', ' ', ':', ':' };
85 int n = (int)strlen(zIn);
86 int i, j;
87 int addZulu = 0;
88
89

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button