We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 867901d commit af10378Copy full SHA for af10378
src/interfaces/odbc/multibyte.c
@@ -253,18 +253,18 @@ unsigned char *
253
pg_mbschr(int csc, const unsigned char *string, unsigned int character)
254
{
255
int mb_st = 0;
256
- unsigned char *s;
257
- s = (unsigned char *) string;
+ const unsigned char *s, *rs = NULL;
258
259
- for(;;)
+ for(s = string; *s ; s++)
260
261
mb_st = pg_CS_stat(mb_st, (unsigned char) *s, csc);
262
- if (mb_st == 0 && (*s == character || *s == 0))
+ if (mb_st == 0 && (*s == character))
+ {
263
+ rs = s;
264
break;
- else
265
- s++;
+ }
266
}
267
- return (s);
+ return (rs);
268
269
270
int
0 commit comments