Enlightenment CVS committal Author : vacuum Project : e17 Module : libs/embryo
Dir : e17/libs/embryo/src/bin Modified Files: embryo_cc_sc1.c embryo_cc_sc2.c Log Message: sprintf -> snprintf =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc1.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- embryo_cc_sc1.c 11 Jul 2004 09:50:42 -0000 1.12 +++ embryo_cc_sc1.c 25 Jul 2004 04:40:16 -0000 1.13 @@ -19,7 +19,7 @@ * must not be misrepresented as being the original software. * 3. This notice may not be removed or altered from any source * distribution. - * Version: $Id: embryo_cc_sc1.c,v 1.12 2004/07/11 09:50:42 tsauerbeck Exp $ + * Version: $Id: embryo_cc_sc1.c,v 1.13 2004/07/25 04:40:16 vacuum Exp $ */ #include <assert.h> #include <ctype.h> @@ -2151,7 +2151,7 @@ { tag &= TAGMASK; assert(tag >= 0); - sprintf(dest, "0%x", tag); + snprintf(dest, sizeof(dest)-1, "0%x", tag); return isdigit(dest[1]) ? &dest[1] : dest; } @@ -2165,12 +2165,12 @@ assert(numtags >= 1 && numtags <= 2); opertok = (opername[1] == '\0') ? opername[0] : 0; if (opertok == '=') - sprintf(symname, "%s%s%s", tag2str(tagstr1, resulttag), opername, + snprintf(symname, sizeof(symname)-1, "%s%s%s", tag2str(tagstr1, resulttag), opername, tag2str(tagstr2, tag1)); else if (numtags == 1 || opertok == '~') - sprintf(symname, "%s%s", opername, tag2str(tagstr1, tag1)); + snprintf(symname, sizeof(symname)-1, "%s%s", opername, tag2str(tagstr1, tag1)); else - sprintf(symname, "%s%s%s", tag2str(tagstr1, tag1), opername, + snprintf(symname, sizeof(symname)-1, "%s%s%s", tag2str(tagstr1, tag1), opername, tag2str(tagstr2, tag2)); return symname; } @@ -2226,7 +2226,7 @@ assert(tagsym[1] != NULL); if (unary) { - sprintf(dest, "operator%s(%s:)", opname, tagsym[1]->name); + snprintf(dest, sizeof(dest)-1, "operator%s(%s:)", opname, tagsym[1]->name); } else { @@ -2234,11 +2234,11 @@ /* special case: the assignment operator has the return value * as the 2nd tag */ if (opname[0] == '=' && opname[1] == '\0') - sprintf(dest, "%s:operator%s(%s:)", tagsym[0]->name, opname, - tagsym[1]->name); + snprintf(dest, sizeof(dest)-1, "%s:operator%s(%s:)", tagsym[0]->name, + opname, tagsym[1]->name); else - sprintf(dest, "operator%s(%s:,%s:)", opname, tagsym[0]->name, - tagsym[1]->name); + snprintf(dest, sizeof(dest)-1, "operator%s(%s:,%s:)", opname, + tagsym[0]->name, tagsym[1]->name); } /* if */ return dest; } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc2.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- embryo_cc_sc2.c 11 Jul 2004 09:50:42 -0000 1.8 +++ embryo_cc_sc2.c 25 Jul 2004 04:40:16 -0000 1.9 @@ -18,7 +18,7 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * - * Version: $Id: embryo_cc_sc2.c,v 1.8 2004/07/11 09:50:42 tsauerbeck Exp $ + * Version: $Id: embryo_cc_sc2.c,v 1.9 2004/07/25 04:40:16 vacuum Exp $ */ #include <assert.h> #include <stdio.h> @@ -1196,7 +1196,7 @@ extern char *sc_tokens[]; /* forward declaration */ if (tok < 256) - sprintf(s2, "%c", (char)tok); + snprintf(s2, sizeof(s2)-1, "%c", (char)tok); else strcpy(s2, sc_tokens[tok - tFIRST]); error(1, sc_tokens[tSYMBOL - tFIRST], s2); @@ -2139,13 +2139,13 @@ /* token already pushed back */ assert(_pushed); if (token < 256) - sprintf(s1, "%c", (char)token); /* single character token */ + snprintf(s1, sizeof(s1)-1, "%c", (char)token); /* single character token */ else strcpy(s1, sc_tokens[token - tFIRST]); /* multi-character symbol */ if (!freading) strcpy(s2, "-end of file-"); else if (_lextok < 256) - sprintf(s2, "%c", (char)_lextok); + snprintf(s2, sizeof(s1)-1, "%c", (char)_lextok); else strcpy(s2, sc_tokens[_lextok - tFIRST]); error(1, s1, s2); /* expected ..., but found ... */ ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs