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.
Commit
19f1544e2b760ebdb2a4b9f6bb3ed072540fb3167b93ca6a5d291b49fe33a698
Parent
ad6172d525212be…
1 file changed
+1
-1
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -78,11 +78,11 @@ | ||
| 78 | 78 | ** the input string is a hash prefix and NULL is returned if it is. If the |
| 79 | 79 | ** bVerifyNotAHash flag is false, then the result is determined by syntax |
| 80 | 80 | ** of the input string only, without reference to the artifact table. |
| 81 | 81 | */ |
| 82 | 82 | char *fossil_expand_datetime(const char *zIn,int bVerifyNotAHash,int bRoundUp){ |
| 83 | - static char zEDate[24]; | |
| 83 | + static char zEDate[25]; | |
| 84 | 84 | static const char aPunct[] = { 0, 0, '-', '-', ' ', ':', ':' }; |
| 85 | 85 | int n = (int)strlen(zIn); |
| 86 | 86 | int i, j; |
| 87 | 87 | int addZulu = 0; |
| 88 | 88 | |
| 89 | 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[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 |