summaryrefslogtreecommitdiff
path: root/tests/test_strerror.test
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2020-08-22 11:35:50 +0200
committerTobias Stoeckmann <tobias@stoeckmann.org>2020-08-22 11:35:50 +0200
commit4298431150df9a83390a14006217c230e684994b (patch)
tree1b3294f56fc7b49bf3eed3d41ffebe73561802ab /tests/test_strerror.test
parent2b439ea59857747067e8272011ad67303e0d4cf1 (diff)
downloadjson-c-4298431150df9a83390a14006217c230e684994b.tar.gz
Properly format errnos in _json_c_strerror
The function _json_c_strerror does not properly format unknown errnos. The int to ascii loop ignores the leading digit if the number can be divided by 10 and if an errno has been formatted, shorter errnos would not properly terminate the newly created string, showing the ending numbers of the previous output. A test case has been added to show these effects. Since this function has been introduced for tests, the effect of this on real life code is basically non-existing. First an environment variable has to be set to activate this strerror code and second an unknown errno would have to be encountered.
Diffstat (limited to 'tests/test_strerror.test')
l---------tests/test_strerror.test1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test_strerror.test b/tests/test_strerror.test
new file mode 120000
index 0000000..58a13f4
--- /dev/null
+++ b/tests/test_strerror.test
@@ -0,0 +1 @@
+test_basic.test \ No newline at end of file