|
| 1 | +# |
| 2 | +# Copyright (c) 2021-2022, Alden Torres |
| 3 | +# |
| 4 | +# Licensed under the terms of the MIT license. |
| 5 | +# Copy of the license at https://opensource.org/licenses/MIT |
| 6 | +# |
| 7 | + |
1 | 8 | import json |
2 | 9 | import re |
3 | 10 | import subprocess |
@@ -396,6 +403,7 @@ def gen_js(headers, ignore): |
396 | 403 | out += " * @return {number}\n" |
397 | 404 | out += " */\n" |
398 | 405 | out += "function mput(src, size) {\n" |
| 406 | + out += " if (!src) return 0;\n" |
399 | 407 | out += " const pos = _ecc_malloc(size);\n" |
400 | 408 | out += " arraycopy(src, 0, HEAPU8, pos, size);\n" |
401 | 409 | out += " return pos;\n" |
@@ -428,7 +436,7 @@ def gen_js(headers, ignore): |
428 | 436 | def gen_jni_c(headers, ignore): |
429 | 437 | out = "" |
430 | 438 | out += "/*\n" |
431 | | - out += " * Copyright (c) 2021, Alden Torres\n" |
| 439 | + out += " * Copyright (c) 2021-2022, Alden Torres\n" |
432 | 440 | out += " *\n" |
433 | 441 | out += " * Licensed under the terms of the MIT license.\n" |
434 | 442 | out += " * Copy of the license at https://opensource.org/licenses/MIT\n" |
@@ -473,7 +481,7 @@ def gen_jni_c(headers, ignore): |
473 | 481 | def gen_jni_java(headers, ignore): |
474 | 482 | out = "" |
475 | 483 | out += "/*\n" |
476 | | - out += " * Copyright (c) 2021, Alden Torres\n" |
| 484 | + out += " * Copyright (c) 2021-2022, Alden Torres\n" |
477 | 485 | out += " *\n" |
478 | 486 | out += " * Licensed under the terms of the MIT license.\n" |
479 | 487 | out += " * Copy of the license at https://opensource.org/licenses/MIT\n" |
|
0 commit comments