summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-06-15 15:34:55 +0200
committerRobin Watts <robin.watts@artifex.com>2018-06-22 16:48:45 +0100
commit2daa34ef06b621414946006314cb262a474b1203 (patch)
treee4135dd62aaf7780482c8fa076669b4bef16cb5c
parent072703ee156c94cd951cf2c406f4ff64e2ed094f (diff)
downloadmupdf-2daa34ef06b621414946006314cb262a474b1203.tar.xz
Fix error check in AFPercent_Format to look for null rather than false.
The number 0 is a valid percentage number.
-rw-r--r--source/pdf/js/util.js2
-rw-r--r--source/pdf/js/util.js.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/pdf/js/util.js b/source/pdf/js/util.js
index c634f781..ce60ec43 100644
--- a/source/pdf/js/util.js
+++ b/source/pdf/js/util.js
@@ -860,7 +860,7 @@ function AFPercent_Keystroke(nDec, sepStyle) {
function AFPercent_Format(nDec, sepStyle) {
var val = AFMakeNumber(event.value);
- if (!val) {
+ if (val == null) {
event.value = '';
return;
}
diff --git a/source/pdf/js/util.js.h b/source/pdf/js/util.js.h
index a4e5124f..9d356c1a 100644
--- a/source/pdf/js/util.js.h
+++ b/source/pdf/js/util.js.h
@@ -860,7 +860,7 @@
"\n"
"function AFPercent_Format(nDec, sepStyle) {\n"
"var val = AFMakeNumber(event.value);\n"
-"if (!val) {\n"
+"if (val == null) {\n"
"event.value = '';\n"
"return;\n"
"}\n"