Patch pat.3

From: Andrew Valencia <vandys_at_nospam.org>
Date: Tue Aug 17 1993 - 21:19:41 PDT

This patch fixes a conformance problem with the type of strlen().
It should be size_t. GCC has built-ins and built-in knowledge of
such things, so it complains. This should fix that.

*** c:/tmp/T0AA.AAA Tue Aug 17 21:14:36 1993
--- include/string.h Mon Aug 16 08:29:14 1993
***************
*** 10,18 ****
   * Prototypes
   */
  extern char *strcpy(char *, const char *), *strncpy(char *, const char *, int);
  extern char *strcat(char *, const char *), *strncat(char *, const char *, int);
! extern int strlen(const char *), strcmp(const char *, const char *),
          strncmp(const char *, const char *, int);
  extern void *memcpy(void *, const void *, size_t);
  extern char *strchr(const char *, int), *strrchr(const char *, int);
  extern char *index(const char *, int), *rindex(const char *, int);
--- 10,19 ----
   * Prototypes
   */
  extern char *strcpy(char *, const char *), *strncpy(char *, const char *, int);
  extern char *strcat(char *, const char *), *strncat(char *, const char *, int);
! extern size_t strlen(const char *);
! extern int strcmp(const char *, const char *),
          strncmp(const char *, const char *, int);
  extern void *memcpy(void *, const void *, size_t);
  extern char *strchr(const char *, int), *strrchr(const char *, int);
  extern char *index(const char *, int), *rindex(const char *, int);
*** c:/tmp/T0AA.AAA Tue Aug 17 21:14:36 1993
--- libc/string.c Mon Aug 16 08:29:38 1993
***************
*** 40,50 ****
  /*
   * strlen()
   * Length of string
   */
  strlen(const char *p)
  {
! int x = 0;
  
          while (*p++)
                  ++x;
          return(x);
--- 40,51 ----
  /*
   * strlen()
   * Length of string
   */
+ size_t
  strlen(const char *p)
  {
! size_t x = 0;
  
          while (*p++)
                  ++x;
          return(x);
Received on Tue Aug 17 21:26:41 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 19:37:12 PDT