aboutsummaryrefslogtreecommitdiff
path: root/audio/squash/files/patch-src__display.c
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2011-03-21 16:22:42 +0000
committerMatthias Andree <mandree@FreeBSD.org>2011-03-21 16:22:42 +0000
commit04e4b0dacfedc821c76389ef0e9943aeb4c1200b (patch)
tree7dfeb6777312c0b95caefb5d6296df4c757ff82c /audio/squash/files/patch-src__display.c
parent5680d0e975821b2435bac5aeadfb87b59dfae86a (diff)
downloadports-04e4b0dacfedc821c76389ef0e9943aeb4c1200b.tar.gz
ports-04e4b0dacfedc821c76389ef0e9943aeb4c1200b.zip
Notes
Diffstat (limited to 'audio/squash/files/patch-src__display.c')
-rw-r--r--audio/squash/files/patch-src__display.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/audio/squash/files/patch-src__display.c b/audio/squash/files/patch-src__display.c
new file mode 100644
index 000000000000..eddc376beaad
--- /dev/null
+++ b/audio/squash/files/patch-src__display.c
@@ -0,0 +1,34 @@
+--- ./src/display.c.orig 2003-12-07 22:20:41.000000000 +0100
++++ ./src/display.c 2011-03-21 17:21:19.000000000 +0100
+@@ -179,6 +179,22 @@
+ return (void *)NULL;
+ }
+
++char *mystrndup(const char *s, size_t sz)
++{
++ size_t l = strlen(s), i;
++ char *x;
++
++ i = l < sz ? l : sz;
++
++ x = malloc(i + 1);
++
++ if (x) {
++ memcpy(x, s, i);
++ x[i] = '\0';
++ }
++ return x;
++}
++
+ /*
+ * Draw the screen, This takes into account rebuilding all the
+ * windows in case of screen resize, or if a window changes size.
+@@ -1567,7 +1583,7 @@
+ }
+
+ /* Clip filename */
+- filename = strndup( filename, win_width - 2 );
++ filename = mystrndup( filename, win_width - 2 );
+
+ /* Display filename and songs loaded */
+ mvwprintw( win, 1, 1, "Current Selected Song filename:" );