diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-27 20:36:13 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-06-27 20:36:13 -0400 |
commit | 25b0547949a05839988dae236fa9a28be6573586 (patch) | |
tree | 3d6956ea1b5cdfcd3716adeed905b4fe861ff210 /awk.h | |
parent | e4863f1b6341cbcc4132a8161e000e81092b4d65 (diff) | |
download | egawk-25b0547949a05839988dae236fa9a28be6573586.tar.gz egawk-25b0547949a05839988dae236fa9a28be6573586.tar.bz2 egawk-25b0547949a05839988dae236fa9a28be6573586.zip |
Add comment to awk.h regarding the potential lack of NUL-termination for strings.
Diffstat (limited to 'awk.h')
-rw-r--r-- | awk.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -476,6 +476,13 @@ typedef struct exp_node { #define re_cnt flags /* Node_val */ +/* + * Note that the string in stptr may not be NUL-terminated, but it is + * guaranteed to have at least one extra byte that may be temporarily set + * to '\0'. This is helpful when calling functions such as strtod that require + * a NUL-terminated argument. In particular, field values $n for n > 0 and + * n < NF will not have a NUL terminator, since they point into the $0 buffer. + */ #define stptr sub.val.sp #define stlen sub.val.slen #define valref sub.val.sref |