Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cifti/afni_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,8 @@ static int64_t loc_strnlen(const char * str, int64_t maxlen)
const char * sptr;
int64_t len;

for( sptr=str, len=0; *sptr && len<maxlen; sptr++, len++)
/* test the length first: str need not be terminated within maxlen */
for( sptr=str, len=0; len<maxlen && *sptr; sptr++, len++)
;

return len; /* max of maxlen */
Expand Down
Loading