| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/audio/squash/files/ |
Upload File : |
--- src/display.c.orig 2003-12-07 21:20:41 UTC
+++ src/display.c
@@ -179,6 +179,22 @@ void *display_monitor( void *input_data
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 @@ void draw_info( void ) {
}
/* 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:" );