src/filegen.c: fix bug introduced in 0fdbc68915

This commit is contained in:
Christophe Grenier 2023-10-21 17:47:02 +02:00
parent 1917ee48c1
commit 551a2b2a5b

View file

@ -696,11 +696,12 @@ static int _file_rename(char *filename, const void *buffer, const int buffer_siz
*dst++ = '_'; *dst++ = '_';
/*@ /*@
@ loop invariant offset <= off <= buffer_size; @ loop invariant offset <= off <= buffer_size;
@ loop invariant valid_read_string(src);
@*/ @*/
for(off=offset; off<buffer_size && *src!='\0'; off++) for(off=offset; off<buffer_size; off++)
{ {
const char c=((const char *)buffer)[off]; const char c=((const char *)buffer)[off];
if(c=='\0')
break;
switch(c) switch(c)
{ {
case '/': case '/':