diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 8a993ad8bc349d9efdd56be37d9ca87db893e079
parent a7720bb918e6fe3cb62b24b318c03c944522c920
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Mon,  5 Jul 2021 01:09:45 +0200

'for' loop initial declarations only in C99 mode

Diffstat:
Msrc/utils.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/utils.c b/src/utils.c @@ -273,8 +273,9 @@ char* expand_path(const char* str) { // Get last occurence of string in string // https://stackoverflow.com/questions/20213799/finding-last-occurence-of-string char* strrstr(char *haystack, char *needle) { + char *i; int nlen = strlen(needle); - for (char* i = haystack + strlen(haystack) - nlen; i >= haystack; i--) { + for (i = haystack + strlen(haystack) - nlen; i >= haystack; i--) { if (strncmp(i, needle, nlen) == 0) { return i; }