convert-modeswitch.pl: fix message indices
authorFelix Fietkau <nbd@nbd.name>
Wed, 24 May 2017 10:15:52 +0000 (12:15 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 24 May 2017 10:15:54 +0000 (12:15 +0200)
Avoid treating index 0 the same way as not defined.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
convert-modeswitch.pl

index 7b2323b51860c821839c7917ae81ae99bb0a24bb..6930e5f8d66864e72ada4b15e783fa5bc822b067 100755 (executable)
@@ -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;
        };