[sword-cvs] sword/src/utilfuns utilweb.cpp,1.3,1.4

sword@www.crosswire.org sword@www.crosswire.org
Fri, 6 Jun 2003 18:55:40 -0700


Update of /usr/local/cvsroot/sword/src/utilfuns
In directory www:/tmp/cvs-serv21232/src/utilfuns

Modified Files:
	utilweb.cpp 
Log Message:
Changed snprintf to sprintf because snprintf is non-standard according to man.
included stdio.h since neither would compile on crosswire without this


Index: utilweb.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/utilfuns/utilweb.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** utilweb.cpp	6 Jun 2003 18:25:56 -0000	1.3
--- utilweb.cpp	7 Jun 2003 01:55:38 -0000	1.4
***************
*** 1,3 ****
--- 1,4 ----
  #include <utilxml.h>
+ #include <stdio.h>
  #include <string>
  #include <map>
***************
*** 17,22 ****
  			}
  
! 			char s[3];
! 			snprintf(s, 3, "%-.2X", c); //left-aligned, 2 digits, uppercase hex
  			m[c] = string("%") + s; //encoded char is "% + 2 digit hex code of char"
  	}
--- 18,23 ----
  			}
  
! 			char s[5];
! 			sprintf(s, "%-.2X", c); //left-aligned, 2 digits, uppercase hex
  			m[c] = string("%") + s; //encoded char is "% + 2 digit hex code of char"
  	}