File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -340,3 +340,15 @@ static char *apsw_strdup(const char *source)
340340 strcpy (res , source );
341341 return res ;
342342}
343+
344+ /* It is 2016 - why do I have to write this? */
345+ static size_t apsw_strnlen (const char * s , size_t maxlen )
346+ {
347+ size_t res = 0 ;
348+ while (* s && res < maxlen )
349+ {
350+ s ++ ;
351+ res ++ ;
352+ }
353+ return res ;
354+ }
Original file line number Diff line number Diff line change @@ -1254,7 +1254,7 @@ apswvfspy_xGetLastError(APSWVFS *self)
12541254 memset (PyBytes_AS_STRING (text ), 0 , size );
12551255
12561256 errval = self -> basevfs -> xGetLastError (self -> basevfs , size , PyBytes_AS_STRING (text ));
1257- msglen = strnlen (PyBytes_AS_STRING (text ), size );
1257+ msglen = apsw_strnlen (PyBytes_AS_STRING (text ), size );
12581258 if (msglen > 0 )
12591259 _PyBytes_Resize (& text , msglen );
12601260 else
You can’t perform that action at this time.
0 commit comments