Browse Source

rtl_fm: non-gnu str functions

Signed-off-by: Steve Markgraf <steve@steve-m.de>
Kyle Keen 12 years ago
parent
commit
71b254a238
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/rtl_fm.c

+ 2 - 1
src/rtl_fm.c

@@ -576,7 +576,8 @@ double atofs(char* f)
 {
 	char* chop;
         double suff = 1.0;
-	chop = strndup(f, strlen(f)-1);
+	chop = malloc((strlen(f)+1)*sizeof(char));
+	strncpy(chop, f, strlen(f)-1);
 	switch (f[strlen(f)-1]) {
 		case 'G':
 			suff *= 1e3;