home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctchnqs / 1990 / number3 / antitest.c < prev    next >
C/C++ Source or Header  |  1990-04-15  |  731b  |  27 lines

  1. /**************************************************************************
  2.  *  Listing 3 - ANTITEST.C  Test driver for anti_venom function.
  3.  *
  4.  *  Written by Kevin D. Weeks 10-8-89
  5.  *  Released to the Public Domain.
  6.  *
  7.  *  Compile using small memory model and link to ANTIVENM.OBJ.
  8.  */
  9. #include <stdio.h>
  10. #define BUF_SIZE    1024
  11.  
  12. main()
  13. {
  14.     int     ret_code;
  15.     char    *buffer;
  16.  
  17.     buffer = (char *)malloc(BUF_SIZE);      /* allocate an input buffer */
  18.     ret_code = anti_venom(BUF_SIZE,buffer); /* test ourselves */
  19.     if (ret_code == -1)
  20.         printf("Virus detected\n");
  21.     else
  22.         if (ret_code == 1)
  23.             printf("Execution error\n");
  24.         else
  25.             printf("OK\n");
  26. }
  27.