summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/bti/files/bti-031-nonGNU.patch')
-rw-r--r--net-misc/bti/files/bti-031-nonGNU.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/net-misc/bti/files/bti-031-nonGNU.patch b/net-misc/bti/files/bti-031-nonGNU.patch
new file mode 100644
index 000000000000..14b10c1fb832
--- /dev/null
+++ b/net-misc/bti/files/bti-031-nonGNU.patch
@@ -0,0 +1,32 @@
+Avoid using strchrnul, it's a GNU addition. The code in question,
+actually doesn't really benefit from strchrnul's behaviour.
+
+--- config.c
++++ config.c
+@@ -351,20 +351,21 @@
+ * marker if it occurs at the beginning of the line, or after
+ * whitespace
+ */
+- hashmarker = strchrnul(line, '#');
++ hashmarker = strchr(line, '#');
+ if (line == hashmarker)
+ line[0] = '\0';
+ else {
+- while (hashmarker[0] != '\0') {
++ while (hashmarker != NULL) {
+ --hashmarker;
+- if (isblank(hashmarker[0]))
++ if (isblank(hashmarker[0])) {
+ hashmarker[0] = '\0';
+- else {
++ break;
++ } else {
+ /*
+ * false positive; '#' occured
+ * within a string
+ */
+- hashmarker = strchrnul(hashmarker+2, '#');
++ hashmarker = strchr(hashmarker+2, '#');
+ }
+ }
+ }