summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-11-24 12:38:56 +0100
committerPali Rohár <pali.rohar@gmail.com>2012-11-24 12:38:56 +0100
commit3e863759d3e37194884b0b27d9e005855768acb6 (patch)
tree7e8060336b3d6559faeedba17a5557f6ad511ba4 /src/device.c
parent87202c38a03e093082def8f3cf6da2aa1bad25f8 (diff)
download0xFFFF-3e863759d3e37194884b0b27d9e005855768acb6.tar.bz2
device: Fix memory corruption, do not call log10(0)
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 78c3a7b..7f2a84d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -143,7 +143,7 @@ char * hwrevs_alloc_to_string(const int16_t * hwrevs) {
int len = 0;
for ( i = 0; hwrevs[i] != -1; ++i )
- len += log10(hwrevs[i])+2;
+ len += log10(hwrevs[i]+1)+2;
ret = calloc(1, len+1);
if ( ! ret )