summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--LICENSE.FreeBSD27
-rw-r--r--lscp.c7
3 files changed, 34 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 752a776..ba589d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
*.o
-lscp
-txttopng
input.txt
+lint.lnt
+lscp
output.png
+predef-c.h
+txttopng
diff --git a/LICENSE.FreeBSD b/LICENSE.FreeBSD
new file mode 100644
index 0000000..ad69a85
--- /dev/null
+++ b/LICENSE.FreeBSD
@@ -0,0 +1,27 @@
+# @(#)COPYRIGHT 8.2 (Berkeley) 3/21/94
+
+The compilation of software known as FreeBSD is distributed under the
+following terms:
+
+Copyright (c) 1992-2023 The FreeBSD Project.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/lscp.c b/lscp.c
index fdc9857..647ade2 100644
--- a/lscp.c
+++ b/lscp.c
@@ -39,10 +39,9 @@ int main(int aArgc, char **aArgv) {
fprintf(stderr, "usage: %s start end\n", aArgv[0]);
exit(EXIT_FAILURE);
}
- unsigned long start, end;
errno = 0;
- start = strtoul(aArgv[1], NULL, 0);
- end = strtoul(aArgv[2], NULL, 0);
+ const unsigned long start = strtoul(aArgv[1], NULL, 0);
+ const unsigned long end = strtoul(aArgv[2], NULL, 0);
if (errno != 0) {
fprintf(stderr, "could not convert arguments to integers\n");
exit(EXIT_FAILURE);
@@ -50,7 +49,7 @@ int main(int aArgc, char **aArgv) {
for (unsigned long i = start; i < end; ++i) {
char name[UNINAME_MAX + 1];
const char *const p = unicode_character_name((ucs4_t) i, name);
- printf("U+%04x %2d a %lc b %s\n", (unsigned int) i, wcwidth(i), (wint_t) i, p ? p : "<no name>");
+ printf("U+%04lx %2d a %lc b %s\n", i, wcwidth((wchar_t) i), (wint_t) i, p ? p : "<no name>");
}
return EXIT_SUCCESS;
}