/[jscoverage]/trunk/util.c
ViewVC logotype

Diff of /trunk/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 106 by siliconforks, Sat May 31 07:37:39 2008 UTC revision 125 by siliconforks, Mon Jun 2 17:52:38 2008 UTC
# Line 417  Line 417 
417    }    }
418  }  }
419    
420  #ifndef HAVE_CLOSESOCKET  #ifndef HAVE_STRNDUP
421  int closesocket(int s) {  char * strndup(const char * s, size_t size) {
422    return close(s);    size_t length = strlen(s);
423      if (length > size) {
424        char * result = xmalloc(size + 1);
425        strncpy(result, s, size);
426        result[size] = '\0';
427        return result;
428      }
429      else {
430        char * result = xmalloc(length + 1);
431        strcpy(result, s);
432        return result;
433      }
434  }  }
435  #endif  #endif
436    

Legend:
Removed from v.106  
changed lines
  Added in v.125

  ViewVC Help
Powered by ViewVC 1.1.24