diff options
author | Damien George <damien.p.george@gmail.com> | 2014-08-26 23:35:57 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-08-26 23:35:57 +0100 |
commit | b427d6ae8686f4a9520509cb73ab9f1327ceadc1 (patch) | |
tree | c901f97e42362298590b05aa31cbffe3ecedf7d3 /py/emitglue.c | |
parent | f05b87bd639ef7dbe14d40c912a802c50a762553 (diff) | |
download | micropython-b427d6ae8686f4a9520509cb73ab9f1327ceadc1.tar.gz micropython-b427d6ae8686f4a9520509cb73ab9f1327ceadc1.zip |
py: Fix line number printing for file with 1 line.
With a file with 1 line (and an error on that line), used to show the
line as number 0. Now shows it correctly as line number 1.
But, when line numbers are disabled, it now prints line number 1 for any
line that has an error (instead of 0 as previously). This might end up
being confusing, but requires extra RAM and/or hack logic to make it
print something special in the case of no line numbers.
Diffstat (limited to 'py/emitglue.c')
-rw-r--r-- | py/emitglue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/py/emitglue.c b/py/emitglue.c index 5916586aea..99cd3f3832 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -107,7 +107,7 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void #ifdef WRITE_CODE FILE *fp_write_code = fopen("out-code", "wb"); - fwrite(fun_data, len, 1, fp_write_code); + fwrite(fun_data, fun_len, 1, fp_write_code); fclose(fp_write_code); #endif #endif |