From: Felix Fietkau Date: Wed, 24 May 2017 10:15:52 +0000 (+0200) Subject: convert-modeswitch.pl: fix message indices X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=453da8e540b1c53d357b897d6c70372cd4633390;p=project%2Fusbmode.git convert-modeswitch.pl: fix message indices Avoid treating index 0 the same way as not defined. Signed-off-by: Felix Fietkau --- diff --git a/convert-modeswitch.pl b/convert-modeswitch.pl index 7b2323b..6930e5f 100755 --- a/convert-modeswitch.pl +++ b/convert-modeswitch.pl @@ -9,7 +9,7 @@ sub add_message { my $msg = shift; my $val = $messages{$msg}; - $val or do { + defined($val) or do { $val = $msg_ctr++; $messages{$msg} = $val; };