C89 fix (SF#1613348: http://sourceforge.net/tracker/index.php?func=detail&aid=1613348...
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 13 Dec 2006 01:08:14 +0000 (01:08 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 13 Dec 2006 01:08:14 +0000 (01:08 +0000)
src/test_streams/main.c

index 526c757..a864783 100644 (file)
@@ -730,13 +730,15 @@ int main(int argc, char *argv[])
        is_big_endian_host = (*((FLAC__byte*)(&test)))? false : true;
 
 #if !defined _MSC_VER && !defined __MINGW32__
-       struct timeval tv;
+       {
+               struct timeval tv;
 
-       if(gettimeofday(&tv, 0) < 0) {
-               fprintf(stderr, "WARNING: couldn't seed RNG with time\n");
-               tv.tv_usec = 4321;
+               if(gettimeofday(&tv, 0) < 0) {
+                       fprintf(stderr, "WARNING: couldn't seed RNG with time\n");
+                       tv.tv_usec = 4321;
+               }
+               srandom(tv.tv_usec);
        }
-       srandom(tv.tv_usec);
 #else
        srand(time(0));
 #endif