From 067ccfe286df5cc1516ffbf7a40f710d2c54175c Mon Sep 17 00:00:00 2001 From: Andreas Politz Date: Wed, 4 Feb 2015 19:48:48 +0100 Subject: Fix bugs. * server/epdfinfo.c (command_arg_split): Alloc space for the 0. (cmd_getselection): Use correct index. --- server/epdfinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/epdfinfo.c b/server/epdfinfo.c index b15930f..d412ee9 100644 --- a/server/epdfinfo.c +++ b/server/epdfinfo.c @@ -651,7 +651,7 @@ command_arg_split (const char *args, int *nargs) if (! args) goto theend; - buffer = g_malloc (strlen (args)); + buffer = g_malloc (strlen (args) + 1); while (*args || last) { @@ -2127,7 +2127,7 @@ cmd_getselection (const epdfinfo_t *ctx, const command_arg_t *args) PopplerDocument *doc = args[0].value.doc->pdf; int pn = args[1].value.natnum; PopplerRectangle r = args[2].value.rectangle; - int selection_style = args[5].value.natnum; + int selection_style = args[3].value.natnum; gdouble width, height; cairo_region_t *region = NULL; PopplerPage *page = NULL; -- cgit v1.0