ogajduse / rpms / texlive

Forked from rpms/texlive 6 years ago
Clone
4931932
diff -up texlive-2007/texk/dvipsk/hps.c.dvipsoverflow texlive-2007/texk/dvipsk/hps.c
4931932
--- texlive-2007/texk/dvipsk/hps.c.dvipsoverflow	2007-11-22 15:44:30.000000000 +0100
4931932
+++ texlive-2007/texk/dvipsk/hps.c	2007-11-22 15:46:10.000000000 +0100
4931932
@@ -441,19 +441,32 @@ int href_name_match P2C(char *, h, char 
4931932
 
4931932
 void stamp_hps P1C(Hps_link *, pl)
4931932
 {
4931932
-  char tmpbuf[200] ;
4931932
+  char * tmpbuf;
4931932
   if (pl == NULL) {
4931932
     error("Null pointer, oh no!") ;
4931932
     return ;
4931932
-  } else {
4931932
-    /* print out the proper pdfm with local page info only 
4931932
-     *  target info will be in the target dictionary */
4931932
-    (void)sprintf(tmpbuf, 
4931932
-		  " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ", pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
4931932
-		  pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
4931932
-		  pl->color[0], pl->color[1], pl->color[2]) ;
4931932
-    cmdout(tmpbuf) ; 
4931932
-  }
4931932
+  } 
4931932
+  if(pl->title == NULL) {
4931932
+    error("Null pointer, oh no!") ;
4931932
+    return ;
4931932
+  } 
4931932
+
4931932
+  tmpbuf = (char *) malloc(strlen(pl->title)+200);
4931932
+  if(tmpbuf == NULL) {
4931932
+    error("out of memory, oh no!") ;
4931932
+    return ;
4931932
+  } 
4931932
+
4931932
+  /* print out the proper pdfm with local page info only 
4931932
+   *  target info will be in the target dictionary */
4931932
+  (void)sprintf(tmpbuf, 
4931932
+		" (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ", 
4931932
+		pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
4931932
+		pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
4931932
+		pl->color[0], pl->color[1], pl->color[2]) ;
4931932
+  cmdout(tmpbuf) ; 
4931932
+  free(tmpbuf);
4931932
+  
4931932
   
4931932
 }
4931932
 
4931932
@@ -462,18 +475,31 @@ void stamp_hps P1C(Hps_link *, pl)
4931932
  */
4931932
 void stamp_external P2C(char *, s, Hps_link *, pl) 
4931932
 {
4931932
-  char tmpbuf[200];
4931932
+  char *tmpbuf;
4931932
   if (pl == NULL) {
4931932
     error("Null pointer, oh no!") ;
4931932
     return ;
4931932
-  } else {
4931932
-    /* print out the proper pdfm with local page info only 
4931932
-     *  target info will be in the target dictionary */
4931932
-    (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ", pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
4931932
-		  pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
4931932
-		  pl->color[0], pl->color[1], pl->color[2], s) ;
4931932
-    cmdout(tmpbuf) ;
4931932
-  }
4931932
+  } 
4931932
+
4931932
+  if (s == NULL) {
4931932
+    error("Null pointer, oh no!") ;
4931932
+    return ;
4931932
+  } 
4931932
+
4931932
+  tmpbuf = (char *) malloc(strlen(s) + 200);
4931932
+  if(tmpbuf == NULL) {
4931932
+    error("out of memory, oh no!") ;
4931932
+    return ;
4931932
+  } 
4931932
+
4931932
+  /* print out the proper pdfm with local page info only 
4931932
+   *  target info will be in the target dictionary */
4931932
+  (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ",
4931932
+		pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
4931932
+		pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
4931932
+		pl->color[0], pl->color[1], pl->color[2], s) ;
4931932
+  cmdout(tmpbuf) ;
4931932
+  free(tmpbuf);
4931932
 }
4931932
 
4931932
 void finish_hps P1H(void) {