Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
620 B

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include "y4.h"
  3. #include <ctype.h>
  4. gtnm()
  5. {
  6. register s, val, c;
  7. /* read and convert an integer from the standard input */
  8. /* return the terminating character */
  9. /* blanks, tabs, and newlines are ignored */
  10. s = 1;
  11. val = 0;
  12. while( (c=unix_getc(finput)) != EOF )
  13. {
  14. if( isdigit(c) )
  15. {
  16. val = val * 10 + c - '0';
  17. }
  18. else if ( c == '-' ) s = -1;
  19. else if ( c == '\r') continue;
  20. else break;
  21. }
  22. *pmem++ = s*val;
  23. if( pmem > &mem0[MEMSIZE] ) error( "out of space" );
  24. return( c );
  25. }