Merge commit 'fml/master' into next
[paraslash.git] / amp_filter.c
index a011c41..63b1b9a 100644 (file)
@@ -6,6 +6,8 @@
 
 /** \file amp_filter.c Paraslash's amplify filter. */
 
+#include <regex.h>
+
 #include "para.h"
 #include "amp_filter.cmdline.h"
 #include "list.h"
@@ -76,11 +78,9 @@ static void amp_open(struct filter_node *fn)
 
        pad->conf = fn->conf;
        fn->private_data = pad;
-       if (!pad->conf->amp_given && stat_item_values[SI_AMPLIFICATION]) {
-               int i = SI_AMPLIFICATION;
-               char *s = stat_item_values[i] + strlen(status_item_list[i]) + 1;
-               sscanf(s, "%u", &pad->amp);
-       } else
+       if (!pad->conf->amp_given && stat_item_values[SI_AMPLIFICATION])
+               sscanf(stat_item_values[SI_AMPLIFICATION], "%u", &pad->amp);
+       else
                pad->amp = pad->conf->amp_arg;
        fn->bufsize = AMP_CHUNK_SIZE;
        fn->buf = para_malloc(fn->bufsize);