From: Marcelo M. <mar...@us...> - 2005-03-07 20:36:38
|
Update of /cvsroot/swig/SWIG/Source/Swig In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6912 Modified Files: misc.c Log Message: get rid of static buffers Index: misc.c =================================================================== RCS file: /cvsroot/swig/SWIG/Source/Swig/misc.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** misc.c 16 Dec 2004 02:12:02 -0000 1.27 --- misc.c 7 Mar 2005 20:36:26 -0000 1.28 *************** *** 160,163 **** --- 160,164 ---- while ((c = Getc(s)) != EOF) { if (c == '`') { + String *str = 0; tc = NewString(""); while ((c = Getc(s)) != EOF) { *************** *** 165,169 **** Putc(c,tc); } ! Printf(ns,"%s",SwigType_str(tc,0)); } else { Putc(c,ns); --- 166,172 ---- Putc(c,tc); } ! str = SwigType_str(tc,0); ! Printf(ns,"%s",str); ! Delete(str); } else { Putc(c,ns); *************** *** 358,369 **** String * Swig_scopename_prefix(String *s) { ! char tmp[1024]; ! char *c, *cc; ! if (!Strstr(s,"::")) return 0; ! strcpy(tmp,Char(s)); ! c = tmp; ! cc = c; while (*c) { ! if (strncmp(c,"::",2) == 0) { cc = c; c += 2; --- 361,370 ---- String * Swig_scopename_prefix(String *s) { ! char *tmp = Char(s); ! char *c = tmp; ! char *cc = c; ! if (!strstr(c,"::")) return 0; while (*c) { ! if ((*c == ':') && (*(c+1) == ':')) { cc = c; c += 2; *************** *** 383,389 **** } - *cc = 0; if (cc != tmp) { ! return NewString(tmp); } else { return 0; --- 384,389 ---- } if (cc != tmp) { ! return NewStringWithSize(tmp, cc - tmp); } else { return 0; *************** *** 400,412 **** String * Swig_scopename_last(String *s) { ! char tmp[1024]; ! char *c, *cc; ! if (!Strstr(s,"::")) return NewString(s); ! strcpy(tmp,Char(s)); ! c = tmp; ! cc = c; while (*c) { ! if (strncmp(c,"::",2) == 0) { cc = c; c += 2; --- 400,410 ---- String * Swig_scopename_last(String *s) { ! char *tmp = Char(s); ! char *c = tmp; ! char *cc = c; ! if (!strstr(c,"::")) return NewString(s); while (*c) { ! if ((*c == ':') && (*(c+1) == ':')) { cc = c; c += 2; *************** *** 437,447 **** String * Swig_scopename_first(String *s) { ! char tmp[1024]; ! char *c; ! if (!Strstr(s,"::")) return 0; ! strcpy(tmp,Char(s)); ! c = tmp; while (*c) { ! if (strncmp(c,"::",2) == 0) { break; } else { --- 435,443 ---- String * Swig_scopename_first(String *s) { ! char *tmp = Char(s); ! char *c = tmp; ! if (!strstr(c,"::")) return 0; while (*c) { ! if ((*c == ':') && (*(c+1) == ':')) { break; } else { *************** *** 460,465 **** } if (*c && (c != tmp)) { ! *c = 0; ! return NewString(tmp); } else { return 0; --- 456,460 ---- } if (*c && (c != tmp)) { ! return NewStringWithSize(tmp, c - tmp); } else { return 0; *************** *** 477,487 **** String * Swig_scopename_suffix(String *s) { ! char tmp[1024]; ! char *c; ! if (!Strstr(s,"::")) return 0; ! strcpy(tmp,Char(s)); ! c = tmp; while (*c) { ! if (strncmp(c,"::",2) == 0) { break; } else { --- 472,480 ---- String * Swig_scopename_suffix(String *s) { ! char *tmp = Char(s); ! char *c = tmp; ! if (!strstr(c,"::")) return 0; while (*c) { ! if ((*c == ':') && (*(c+1) == ':')) { break; } else { *************** *** 513,519 **** int Swig_scopename_check(String *s) { char *c = Char(s); ! if (!Strstr(s,"::")) return 0; while (*c) { ! if (strncmp(c,"::",2) == 0) { return 1; } else { --- 506,512 ---- int Swig_scopename_check(String *s) { char *c = Char(s); ! if (!strstr(c,"::")) return 0; while (*c) { ! if ((*c == ':') && (*(c+1) == ':')) { return 1; } else { |