From 527e824293ee934ca5da0ef5424efe5ab7757248 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2001 07:36:09 +0000 Subject: strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf) --- source3/nmbd/nmbd.c | 6 +++--- source3/nmbd/nmbd_sendannounce.c | 2 +- source3/nmbd/nmbd_winsserver.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index ca9d04d768..8b771bc452 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -111,7 +111,7 @@ static BOOL dump_core(void) char *p; pstring dname; pstrcpy( dname, debugf ); - if ((p=strrchr(dname,'/'))) + if ((p=strrchr_m(dname,'/'))) *p=0; pstrcat( dname, "/corefiles" ); mkdir( dname, 0700 ); @@ -558,7 +558,7 @@ static BOOL init_structs(void) if (! *global_myname) { fstrcpy( global_myname, myhostname() ); - p = strchr( global_myname, '.' ); + p = strchr_m( global_myname, '.' ); if (p) *p = 0; } @@ -622,7 +622,7 @@ static BOOL init_structs(void) fstrcpy( local_machine, global_myname ); trim_string( local_machine, " ", " " ); - p = strchr( local_machine, ' ' ); + p = strchr_m( local_machine, ' ' ); if (p) *p = 0; strlower( local_machine ); diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c index eb5839253b..32a6d339de 100644 --- a/source3/nmbd/nmbd_sendannounce.c +++ b/source3/nmbd/nmbd_sendannounce.c @@ -510,7 +510,7 @@ void announce_remote(time_t t) char *wgroup; int i; - wgroup = strchr(s2,'/'); + wgroup = strchr_m(s2,'/'); if (wgroup) *wgroup++ = 0; if (!wgroup || !*wgroup) diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 296102fd99..0ba1aef057 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -43,7 +43,7 @@ static void wins_hook(char *operation, struct name_record *namerec, int ttl) if (!cmd || !*cmd) return; for (p=namerec->name.name; *p; p++) { - if (!(isalnum((int)*p) || strchr("._-",*p))) { + if (!(isalnum((int)*p) || strchr_m("._-",*p))) { DEBUG(3,("not calling wins hook for invalid name %s\n", nmb_namestr(&namerec->name))); return; } @@ -255,7 +255,7 @@ BOOL initialise_wins(void) got_token = next_token(&ptr,ip_str,NULL,sizeof(ip_str)); was_ip = False; - if(got_token && strchr(ip_str, '.')) + if(got_token && strchr_m(ip_str, '.')) { num_ips++; was_ip = True; @@ -310,7 +310,7 @@ BOOL initialise_wins(void) /* Netbios name. # divides the name from the type (hex): netbios#xx */ pstrcpy(name,name_str); - if((p = strchr(name,'#')) != NULL) + if((p = strchr_m(name,'#')) != NULL) { *p = 0; sscanf(p+1,"%x",&type); @@ -1630,7 +1630,7 @@ void wins_write_database(BOOL background) tm = LocalTime(&namerec->data.death_time); ts = asctime(tm); - nl = strrchr( ts, '\n' ); + nl = strrchr_m( ts, '\n' ); if( NULL != nl ) *nl = '\0'; DEBUGADD(4,("TTL = %s ", ts )); -- cgit