Don't move pointer before start of object in move_word_rel()

The old code could move the variable 'pointer' backwards one character before the start
of the string (then incremented it again before returning).  Formally this is undefined
behaviour, so fix it.
This commit is contained in:
Kevin Easton committed 2017-11-12 23:34:54 +11:00
1 parent a71ee883e1
commit 5e40c1ac01
2 files changed
+30 -24

No files matched your search

+1 -1
View File
@@ -134,7 +134,7 @@ char * base64_encode (const void *data, size_t size);
#define EOS 32767
char *BX_strsearch (register char *, char *, char *, int);
char *BX_move_to_abs_word (const register char *, char **, int);
char *BX_move_word_rel (const register char *, char **, int);
char *BX_move_word_rel (const char *, char **, int);
char *BX_extract (char *, int, int);
char *BX_extract2 (const char *, int, int);
int BX_wild_match (const char *, const char *);