[NeoStats-Devel] [Commits] r368 - branches/3.0
[email protected] Sun, 21 Aug 2005 06:38:09 +1000
| Newsgroups | gmane.comp.neostats.devel |
|---|---|
| Message-ID | <[email protected]> |
Author: Mark
Date: Sun Aug 21 04:38:06 2005
New Revision: 368
Modified:
branches/3.0/scan.c
Log:
replace strdup with ns_malloc sequence for Win32 compatibility
Modified: branches/3.0/scan.c
==============================================================================
--- branches/3.0/scan.c (original)
+++ branches/3.0/scan.c Sun Aug 21 04:38:06 2005
@@ -373,11 +373,17 @@
int ScanRealname(Client *u)
{
char *buf;
- int i;
- buf = strdup(u->info);
- strip_mirc_codes(buf);
+ int len;
+ int i = 0;
+
+ len = strlen( u->info );
+ if( len == 0 )
+ return 0;
+ buf = ns_malloc( len );
+ strlcpy( buf, u->info, len );
+ strip_mirc_codes( buf );
i = Scan(DET_REALNAME, u, buf);
- free(buf);
+ ns_free(buf);
return i;
}