X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmbschr.c;h=5997b18cfdb0a1ae05bccea783e32269f9fd8c7a;hb=4cd8485e904c1a98470eb548fe6ac0f04e343c4e;hp=084694d7a6d2a0b363cac8142bf921943fbedb76;hpb=22a636592e5562bef231b878757c5a6efdadabea;p=gnulib.git diff --git a/lib/mbschr.c b/lib/mbschr.c index 084694d7a..5997b18cf 100644 --- a/lib/mbschr.c +++ b/lib/mbschr.c @@ -2,10 +2,10 @@ Copyright (C) 2007 Free Software Foundation, Inc. Written by Bruno Haible , 2007. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include @@ -41,11 +40,11 @@ mbschr (const char *string, int c) for (mbui_init (iter, string);; mbui_advance (iter)) { + if (!mbui_avail (iter)) + goto notfound; if (mb_len (mbui_cur (iter)) == 1 && (unsigned char) * mbui_cur_ptr (iter) == (unsigned char) c) break; - if (!mbui_avail (iter)) - goto notfound; } return (char *) mbui_cur_ptr (iter); notfound: