[Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.70,2.71

Jeremy Hylton jhylton@users.sourceforge.net
Wed, 28 Nov 2001 13:49:53 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv31165

Modified Files:
	cPickle.c 
Log Message:
Use PyOS_snprintf() instead of sprintf().


Index: cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.70
retrieving revision 2.71
diff -C2 -d -r2.70 -r2.71
*** cPickle.c	2001/11/15 23:45:26	2.70
--- cPickle.c	2001/11/28 21:49:51	2.71
***************
*** 670,674 ****
      if (!self->bin) {
          s[0] = GET;
!         sprintf(s + 1, "%ld\n", c_value);
          len = strlen(s);
      }
--- 670,674 ----
      if (!self->bin) {
          s[0] = GET;
!         PyOS_snprintf(s + 1, sizeof(s) - 1, "%ld\n", c_value);
          len = strlen(s);
      }
***************
*** 745,749 ****
      if (!self->bin) {
          c_str[0] = PUT;
!         sprintf(c_str + 1, "%d\n", p);
          len = strlen(c_str);
      }
--- 745,749 ----
      if (!self->bin) {
          c_str[0] = PUT;
!         PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%d\n", p);
          len = strlen(c_str);
      }
***************
*** 959,963 ****
           */
          c_str[0] = INT;
!         sprintf(c_str + 1, "%ld\n", l);
          if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)
              return -1;
--- 959,963 ----
           */
          c_str[0] = INT;
!         PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%ld\n", l);
          if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)
              return -1;
***************
*** 1122,1126 ****
          char c_str[250];
          c_str[0] = FLOAT;
!         sprintf(c_str + 1, "%.17g\n", x);
  
          if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)
--- 1122,1126 ----
          char c_str[250];
          c_str[0] = FLOAT;
!         PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%.17g\n", x);
  
          if ((*self->write_func)(self, c_str, strlen(c_str)) < 0)