Skip to content
Permalink
Browse files Browse the repository at this point in the history
pgo: simplify the example
do not require mkpasswd
and even increase the number of possible build results,
because now we have variations in input length.

Also we are explicitly calling bash
because dash does not know about $RANDOM
  • Loading branch information
bmwiedemann committed Dec 8, 2018
1 parent f0e4ee4 commit 35e1af7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pgo/Makefile
Expand Up @@ -9,7 +9,7 @@ run:
cp -a pgo ../out/

profile:
mkpasswd $$RANDOM | ./pgo || :
bash -c 'echo $$RANDOM' | ./pgo || :

build: pgo
clean:
Expand Down
2 changes: 1 addition & 1 deletion pgo/pgo.c
Expand Up @@ -5,7 +5,7 @@ int main()
char ret=0;
char c;
while(read(0, &c, 1) == 1) {
if(c < 'm') ret++; // count the letters below "m"
if(c < '4') ret++; // count the chars below "4"
}
return ret;
}

0 comments on commit 35e1af7

Please sign in to comment.