freebsd-ports/multimedia/vdr-plugin-eepg/files/patch-eepg.c
Juergen Lock 4efd678f60 - Finish off the year by fixing permissions on the eepg config dir
and adding a missing patch that was forgotten in the initial
  commit.
- Bump PORTREVISION.
2011-12-31 20:49:28 +00:00

17 lines
571 B
C

--- a/eepg.c
+++ b/eepg.c
@@ -427,7 +427,14 @@ static void load_file (int tableid, char
while (fgets (buf, sizeof (buf), fp) != NULL) {
from = binary = to = NULL;
+#ifdef __FreeBSD__
+ from = MALLOC(char, 256);
+ binary = MALLOC(char, 1024);
+ to = MALLOC(char, 256);
+ int elems = sscanf (buf, "%255[^:]:%1023[^:]:%255[^:]:", from, binary, to);
+#else
int elems = sscanf (buf, "%a[^:]:%a[^:]:%a[^:]:", &from, &binary, &to);
+#endif
if (elems == 3) {
int bin_len = strlen (binary);
int from_char = resolve_char (from);