Permalink
Browse files

func.sh: Fix a potential infinite loop in mendel_readsym_target

  • Loading branch information...
1 parent 7198021 commit da2a9c3d5688de930284ece98ee238561eb1fdab @bjj bjj committed with triffid Mar 6, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 func.sh
View
@@ -283,7 +283,7 @@ mendel_readsym_target() {
local val=$(mendel_readsym "$sym")
if [ -n "$val" ]
then
- perl -e '@a = qw/X Y Z E F/; $c = 0; while (length $ARGV[0]) { $ARGV[0] =~ s#^(..)(..)(..)(..)##; printf "%s: %d\n", $a[$c], hex "0x$4$3$2$1"; $c++; }' "$val"
+ perl -e '@a = qw/X Y Z E F/; $c = 0; while (length $ARGV[0]) { last unless $ARGV[0] =~ s#^(..)(..)(..)(..)##; printf "%s: %d\n", $a[$c], hex "0x$4$3$2$1"; $c++; }' "$val"
fi
}

0 comments on commit da2a9c3

Please sign in to comment.