From 0d6b32c371c214277973d7516c6aef3ceeed344b Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sat, 22 Sep 2012 21:00:12 +0200 Subject: device: fix hwrev_is_valid --- src/device.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/device.c') diff --git a/src/device.c b/src/device.c index 3a8abbc..82b3d0f 100644 --- a/src/device.c +++ b/src/device.c @@ -78,9 +78,15 @@ const char * device_to_long_string(enum device device) { int hwrev_is_valid(const int16_t * hwrevs, int16_t hwrev) { int i; + + /* hwrevs not specified, valid for any hwrev */ + if ( ! hwrevs ) + return 1; + for ( i = 0; hwrevs[i] != -1; ++i ) if ( hwrev == hwrevs[i] ) return 1; + return 0; } -- cgit v1.2.3