test-instr.c 789 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. american fuzzy lop - a trivial program to test the build
  3. --------------------------------------------------------
  4. Written and maintained by Michal Zalewski <lcamtuf@google.com>
  5. Copyright 2014 Google Inc. All rights reserved.
  6. Licensed under the Apache License, Version 2.0 (the "License");
  7. you may not use this file except in compliance with the License.
  8. You may obtain a copy of the License at:
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. */
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <unistd.h>
  14. int main(int argc, char** argv) {
  15. char buf[8];
  16. if (read(0, buf, 8) < 1) {
  17. printf("Hum?\n");
  18. exit(1);
  19. }
  20. if (buf[0] == '0')
  21. printf("Looks like a zero to me!\n");
  22. else
  23. printf("A non-zero value? How quaint!\n");
  24. exit(0);
  25. }