diff options
author | Alexander Myltsev <avm@altlinux.org> | 2008-11-24 09:21:13 +0300 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-11-25 16:18:18 +0100 |
commit | b3886dd89f7a3394eed2c9e574909646b6024197 (patch) | |
tree | d937d173163378f4881291b7b3f428936748ac51 | |
parent | 52fa52f93943a6154cf2ac9b473d6b4948d75a15 (diff) |
ps.c: malloc + memset -> calloc
-rw-r--r-- | libspectre/ps.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libspectre/ps.c b/libspectre/ps.c index a5489be..0980f80 100644 --- a/libspectre/ps.c +++ b/libspectre/ps.c @@ -462,9 +462,8 @@ psscan(const char *filename, int scanstyle) if ((iscomment(line,"%!PS") || iscomment(line, "\004%!PS"))) { INFMESSAGE(found "PS-Adobe-" comment) - doc = (struct document *) PS_malloc(sizeof(struct document)); + doc = (struct document *) PS_calloc(1, sizeof(struct document)); CHECK_MALLOCED(doc); - memset(doc, 0, sizeof(struct document)); /* ignore possible leading ^D */ if (*line == '\004') { @@ -499,9 +498,8 @@ psscan(const char *filename, int scanstyle) In a way, this makes sense, a program PostScript does not need the !PS at the beginning. */ - doc = (struct document *) PS_malloc(sizeof(struct document)); + doc = (struct document *) PS_calloc(1, sizeof(struct document)); CHECK_MALLOCED(doc); - memset(doc, 0, sizeof(struct document)); doc->ref_count = 1; doc->filename = _spectre_strdup (filename); doc->default_page_orientation = NONE; |