cosmetic and check for empty string in first_ucase

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-13 18:03:50 +00:00
commit dde9e85198

View file

@ -221,13 +221,13 @@ String *Swig_string_ucase(String *s) {
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
String *Swig_string_first_ucase(String *s) { String *Swig_string_first_ucase(String *s) {
String *ns = NewStringEmpty(); String *ns = NewStringEmpty();
char *cs = Char(s); char *cs = Char(s);
if (cs) { if (cs && cs[0] != 0) {
Putc(toupper(cs[0]),ns); Putc(toupper(cs[0]),ns);
Append(ns, cs + 1); Append(ns, cs + 1);
} }
return ns; return ns;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------