changeset 31914:579d0c6b4270

Avoid a pointless extra variable.
author reimar
date Sat, 21 Aug 2010 09:55:30 +0000
parents 0aaca064dd5c
children c1e009d855b5
files stream/stream_bd.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_bd.c	Sat Aug 21 09:47:08 2010 +0000
+++ b/stream/stream_bd.c	Sat Aug 21 09:55:30 2010 +0000
@@ -21,6 +21,7 @@
 
 #include <stdio.h>
 #include <limits.h>
+#include <ctype.h>
 #include "libavutil/common.h"
 #include "libavutil/aes.h"
 #include "libavutil/sha.h"
@@ -161,7 +162,6 @@
     while (!stream_eof(file)) {
         int i;
         char line[1024];
-        char d[200];
         char *vst;
         unsigned int byte;
 
@@ -183,9 +183,12 @@
         vst = strstr(line, "| V |");
         if (!vst)
             break;
-        sscanf(&vst[6], "%32s", d);
+        vst += 6;
+        while (isspace(*vst)) vst++;
+        if (strlen(vst) < 32)
+            continue;
         for (i = 0; i < 16; i++) {
-            if (sscanf(&d[i*2], "%2x", &byte) != 1)
+            if (sscanf(&vst[i*2], "%2x", &byte) != 1)
                 break;
             bd->vuk.u8[i] = byte;
         }