summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Inoue2002-04-04 01:36:17 +0000
committerHiroshi Inoue2002-04-04 01:36:17 +0000
commitaf10378ab05f7979f0051c09f694709edcee8413 (patch)
treec80940db4bfb003ac1d4d471f51bf927e502c048
parent867901db9efbdae05270931daeb92042dc285710 (diff)
Fix a bug in multibyte_strchr().
-rw-r--r--src/interfaces/odbc/multibyte.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/interfaces/odbc/multibyte.c b/src/interfaces/odbc/multibyte.c
index 3cc3efe350a..476f3c42cd7 100644
--- a/src/interfaces/odbc/multibyte.c
+++ b/src/interfaces/odbc/multibyte.c
@@ -253,18 +253,18 @@ unsigned char *
pg_mbschr(int csc, const unsigned char *string, unsigned int character)
{
int mb_st = 0;
- unsigned char *s;
- s = (unsigned char *) string;
+ const unsigned char *s, *rs = NULL;
- for(;;)
+ for(s = string; *s ; s++)
{
mb_st = pg_CS_stat(mb_st, (unsigned char) *s, csc);
- if (mb_st == 0 && (*s == character || *s == 0))
+ if (mb_st == 0 && (*s == character))
+ {
+ rs = s;
break;
- else
- s++;
+ }
}
- return (s);
+ return (rs);
}
int