Diff for /XML/entities.c between versions 1.63 and 1.64

version 1.63, 2000/09/06 22:05:39 version 1.64, 2000/09/06 22:37:26
Line 779  xmlEncodeEntities(xmlDocPtr doc, const x Line 779  xmlEncodeEntities(xmlDocPtr doc, const x
 #ifndef USE_UTF_8  #ifndef USE_UTF_8
         } else if ((sizeof(xmlChar) == 1) && (*cur >= 0x80)) {          } else if ((sizeof(xmlChar) == 1) && (*cur >= 0x80)) {
             char buf[10], *ptr;              char buf[10], *ptr;
   
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
             snprintf(buf, 9, "&#%d;", *cur);              snprintf(buf, sizeof(buf), "&#%d;", *cur);
 #else  #else
             sprintf(buf, "&#%d;", *cur);              sprintf(buf, "&#%d;", *cur);
 #endif  #endif
               buf[sizeof(buf) - 1] = 0;
             ptr = buf;              ptr = buf;
             while (*ptr != 0) *out++ = *ptr++;              while (*ptr != 0) *out++ = *ptr++;
 #endif  #endif
Line 791  xmlEncodeEntities(xmlDocPtr doc, const x Line 793  xmlEncodeEntities(xmlDocPtr doc, const x
             char buf[10], *ptr;              char buf[10], *ptr;
   
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
             snprintf(buf, 9, "&#%d;", *cur);              snprintf(buf, sizeof(buf), "&#%d;", *cur);
 #else  #else
             sprintf(buf, "&#%d;", *cur);              sprintf(buf, "&#%d;", *cur);
 #endif  #endif
               buf[sizeof(buf) - 1] = 0;
             ptr = buf;              ptr = buf;
             while (*ptr != 0) *out++ = *ptr++;              while (*ptr != 0) *out++ = *ptr++;
         }          }
Line 935  xmlEncodeEntitiesReentrant(xmlDocPtr doc Line 938  xmlEncodeEntitiesReentrant(xmlDocPtr doc
                             "xmlEncodeEntitiesReentrant : input not UTF-8\n");                              "xmlEncodeEntitiesReentrant : input not UTF-8\n");
                     doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");                      doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
                     snprintf(buf, 9, "&#%d;", *cur);                      snprintf(buf, sizeof(buf), "&#%d;", *cur);
 #else  #else
                     sprintf(buf, "&#%d;", *cur);                      sprintf(buf, "&#%d;", *cur);
 #endif  #endif
                       buf[sizeof(buf) - 1] = 0;
                     ptr = buf;                      ptr = buf;
                     while (*ptr != 0) *out++ = *ptr++;                      while (*ptr != 0) *out++ = *ptr++;
                     continue;                      continue;
Line 969  xmlEncodeEntitiesReentrant(xmlDocPtr doc Line 973  xmlEncodeEntitiesReentrant(xmlDocPtr doc
                         "xmlEncodeEntitiesReentrant : char out of range\n");                          "xmlEncodeEntitiesReentrant : char out of range\n");
                     doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");                      doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
                     snprintf(buf, 9, "&#%d;", *cur);                      snprintf(buf, sizeof(buf), "&#%d;", *cur);
 #else  #else
                     sprintf(buf, "&#%d;", *cur);                      sprintf(buf, "&#%d;", *cur);
 #endif  #endif
                     buf[9] = 0;                      buf[sizeof(buf) - 1] = 0;
                     ptr = buf;                      ptr = buf;
                     while (*ptr != 0) *out++ = *ptr++;                      while (*ptr != 0) *out++ = *ptr++;
                     cur++;                      cur++;
Line 983  xmlEncodeEntitiesReentrant(xmlDocPtr doc Line 987  xmlEncodeEntitiesReentrant(xmlDocPtr doc
                  * We could do multiple things here. Just save as a char ref                   * We could do multiple things here. Just save as a char ref
                  */                   */
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
                 snprintf(buf, 9, "&#x%X;", val);                  snprintf(buf, sizeof(buf), "&#x%X;", val);
 #else  #else
                 sprintf(buf, "&#x%X;", val);                  sprintf(buf, "&#x%X;", val);
 #endif  #endif
                 buf[9] = 0;                  buf[sizeof(buf) - 1] = 0;
                 ptr = buf;                  ptr = buf;
                 while (*ptr != 0) *out++ = *ptr++;                  while (*ptr != 0) *out++ = *ptr++;
                 cur += l;                  cur += l;
Line 997  xmlEncodeEntitiesReentrant(xmlDocPtr doc Line 1001  xmlEncodeEntitiesReentrant(xmlDocPtr doc
             char buf[10], *ptr;              char buf[10], *ptr;
   
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
             snprintf(buf, 9, "&#%d;", *cur);              snprintf(buf, sizeof(buf), "&#%d;", *cur);
 #else  #else
             sprintf(buf, "&#%d;", *cur);              sprintf(buf, "&#%d;", *cur);
 #endif  #endif
             buf[9] = 0;              buf[sizeof(buf) - 1] = 0;
             ptr = buf;              ptr = buf;
             while (*ptr != 0) *out++ = *ptr++;              while (*ptr != 0) *out++ = *ptr++;
         }          }

Removed from v.1.63  
changed lines
  Added in v.1.64


Webmaster