summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-js.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/pdf/pdf-js.c')
-rw-r--r--source/pdf/pdf-js.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/pdf/pdf-js.c b/source/pdf/pdf-js.c
index aae1ac79..5b1fb670 100644
--- a/source/pdf/pdf-js.c
+++ b/source/pdf/pdf-js.c
@@ -91,6 +91,7 @@ static void app_alert(js_State *J)
event.icon_type = js_tointeger(J, 2);
event.button_group_type = js_tointeger(J, 3);
event.title = js_tostring(J, 4);
+ event.button_pressed = 0; /* WIP WIP WIP IS THIS CORRECT? */
fz_try(js->ctx)
pdf_event_issue_alert(js->ctx, js->doc, &event);
@@ -161,7 +162,7 @@ static void field_getName(js_State *J)
{
pdf_js *js = js_getcontext(J);
pdf_obj *field = js_touserdata(J, 0, "Field");
- char *name;
+ char *name = NULL;
fz_try(js->ctx)
name = pdf_field_name(js->ctx, js->doc, field);
fz_catch(js->ctx)
@@ -179,7 +180,7 @@ static void field_getDisplay(js_State *J)
{
pdf_js *js = js_getcontext(J);
pdf_obj *field = js_touserdata(J, 0, "Field");
- int display;
+ int display = 0;
fz_try(js->ctx)
display = pdf_field_display(js->ctx, js->doc, field);
fz_catch(js->ctx)
@@ -279,7 +280,7 @@ static void field_getBorderStyle(js_State *J)
{
pdf_js *js = js_getcontext(J);
pdf_obj *field = js_touserdata(J, 0, "Field");
- const char *border_style;
+ const char *border_style = NULL;
fz_try(js->ctx)
border_style = pdf_field_border_style(js->ctx, js->doc, field);
fz_catch(js->ctx)
@@ -302,7 +303,7 @@ static void field_getValue(js_State *J)
{
pdf_js *js = js_getcontext(J);
pdf_obj *field = js_touserdata(J, 0, "Field");
- char *val;
+ char *val = NULL;
fz_try(js->ctx)
val = pdf_field_value(js->ctx, js->doc, field);
@@ -383,7 +384,7 @@ static void doc_getField(js_State *J)
fz_context *ctx = js->ctx;
const char *cName = js_tostring(J, 1);
char *name = pdf_from_utf8(ctx, cName);
- pdf_obj *dict;
+ pdf_obj *dict = NULL;
fz_try(ctx)
dict = pdf_lookup_field(ctx, js->form, name);