r600g/sb: fix buffer overflow in sb_ostream
authorVadim Girlin <vadimgirlin@gmail.com>
Fri, 24 May 2013 12:24:09 +0000 (16:24 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Fri, 24 May 2013 12:40:58 +0000 (16:40 +0400)
Fixes segfault during bytecode dump with bfgminer kernel

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_bc.h

index 8b932634c551f75adeb52f37c074600e325aa9dd..6e73b418d23fc939b67cb716ef2e650fb7dbcbd8 100644 (file)
@@ -92,7 +92,7 @@ public:
 
        sb_ostream& operator <<(double d) {
                char b[32];
-               sprintf(b, "%f", d);
+               snprintf(b, 32, "%g", d);
                return *this << b;
        }