home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / BENCH / FSTRLEN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  911 b   |  39 lines

  1. /* ==( bench/fstrlen.c )== */
  2.  
  3. /* ----------------------------------------------- */
  4. /* Pro-C  Copyright (C) 1988 - 1990 Vestronix Inc. */
  5. /* Modification to this source is not supported    */
  6. /* by Vestronix Inc.                               */
  7. /*            All Rights Reserved                  */
  8. /* ----------------------------------------------- */
  9. /* Written   Nig   1-Jan-87                        */
  10. /* Modified  Geo  11-Dec-89  See comments below    */
  11. /* ----------------------------------------------- */
  12. /* %W%  (%H% %T%) */
  13.  
  14. /*
  15.  *  Modifications
  16.  *
  17.  *  11-Dec-89  Geo - V2 version
  18.  *  25-Oct-89  Geo - 1.32 Merge
  19. */
  20.  
  21. /*  This routine is used to find the length of a field */
  22.  
  23. # include <stdio.h>
  24. # include <bench.h>
  25.  
  26. fstrlen(src, dlen)
  27. char *src;
  28. int  dlen;
  29. {
  30.     char *p = src;
  31.  
  32.     if ( p != NULL)
  33.         while( dlen-- && *p )
  34.             p++;
  35.  
  36.     return ( (int) (p - src) );
  37. }
  38.  
  39.