| 1 |
diff -up texlive-2007/texk/dvipsk/hps.c.dvipsoverflow texlive-2007/texk/dvipsk/hps.c
|
| 2 |
--- texlive-2007/texk/dvipsk/hps.c.dvipsoverflow 2007-11-22 15:44:30.000000000 +0100
|
| 3 |
+++ texlive-2007/texk/dvipsk/hps.c 2007-11-22 15:46:10.000000000 +0100
|
| 4 |
@@ -441,19 +441,32 @@ int href_name_match P2C(char *, h, char
|
| 5 |
|
| 6 |
void stamp_hps P1C(Hps_link *, pl)
|
| 7 |
{
|
| 8 |
- char tmpbuf[200] ;
|
| 9 |
+ char * tmpbuf;
|
| 10 |
if (pl == NULL) {
|
| 11 |
error("Null pointer, oh no!") ;
|
| 12 |
return ;
|
| 13 |
- } else {
|
| 14 |
- /* print out the proper pdfm with local page info only
|
| 15 |
- * target info will be in the target dictionary */
|
| 16 |
- (void)sprintf(tmpbuf,
|
| 17 |
- " (%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,
|
| 18 |
- pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
|
| 19 |
- pl->color[0], pl->color[1], pl->color[2]) ;
|
| 20 |
- cmdout(tmpbuf) ;
|
| 21 |
- }
|
| 22 |
+ }
|
| 23 |
+ if(pl->title == NULL) {
|
| 24 |
+ error("Null pointer, oh no!") ;
|
| 25 |
+ return ;
|
| 26 |
+ }
|
| 27 |
+
|
| 28 |
+ tmpbuf = (char *) malloc(strlen(pl->title)+200);
|
| 29 |
+ if(tmpbuf == NULL) {
|
| 30 |
+ error("out of memory, oh no!") ;
|
| 31 |
+ return ;
|
| 32 |
+ }
|
| 33 |
+
|
| 34 |
+ /* print out the proper pdfm with local page info only
|
| 35 |
+ * target info will be in the target dictionary */
|
| 36 |
+ (void)sprintf(tmpbuf,
|
| 37 |
+ " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ",
|
| 38 |
+ pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
|
| 39 |
+ pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
|
| 40 |
+ pl->color[0], pl->color[1], pl->color[2]) ;
|
| 41 |
+ cmdout(tmpbuf) ;
|
| 42 |
+ free(tmpbuf);
|
| 43 |
+
|
| 44 |
|
| 45 |
}
|
| 46 |
|
| 47 |
@@ -462,18 +475,31 @@ void stamp_hps P1C(Hps_link *, pl)
|
| 48 |
*/
|
| 49 |
void stamp_external P2C(char *, s, Hps_link *, pl)
|
| 50 |
{
|
| 51 |
- char tmpbuf[200];
|
| 52 |
+ char *tmpbuf;
|
| 53 |
if (pl == NULL) {
|
| 54 |
error("Null pointer, oh no!") ;
|
| 55 |
return ;
|
| 56 |
- } else {
|
| 57 |
- /* print out the proper pdfm with local page info only
|
| 58 |
- * target info will be in the target dictionary */
|
| 59 |
- (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,
|
| 60 |
- pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
|
| 61 |
- pl->color[0], pl->color[1], pl->color[2], s) ;
|
| 62 |
- cmdout(tmpbuf) ;
|
| 63 |
- }
|
| 64 |
+ }
|
| 65 |
+
|
| 66 |
+ if (s == NULL) {
|
| 67 |
+ error("Null pointer, oh no!") ;
|
| 68 |
+ return ;
|
| 69 |
+ }
|
| 70 |
+
|
| 71 |
+ tmpbuf = (char *) malloc(strlen(s) + 200);
|
| 72 |
+ if(tmpbuf == NULL) {
|
| 73 |
+ error("out of memory, oh no!") ;
|
| 74 |
+ return ;
|
| 75 |
+ }
|
| 76 |
+
|
| 77 |
+ /* print out the proper pdfm with local page info only
|
| 78 |
+ * target info will be in the target dictionary */
|
| 79 |
+ (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ",
|
| 80 |
+ pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
|
| 81 |
+ pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
|
| 82 |
+ pl->color[0], pl->color[1], pl->color[2], s) ;
|
| 83 |
+ cmdout(tmpbuf) ;
|
| 84 |
+ free(tmpbuf);
|
| 85 |
}
|
| 86 |
|
| 87 |
void finish_hps P1H(void) {
|