summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2004-05-18 18:13:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:37 -0500
commitbb8a4a7991a04e16765f68e5cb770617d086e3d8 (patch)
tree446a3463ffc858395bb3b170ac9ec80a9856a2e0 /source3/libsmb/nmblib.c
parenta30e1a4277500b388de3c8a20f72bb508569f4ce (diff)
downloadsamba-bb8a4a7991a04e16765f68e5cb770617d086e3d8.tar.gz
samba-bb8a4a7991a04e16765f68e5cb770617d086e3d8.tar.bz2
samba-bb8a4a7991a04e16765f68e5cb770617d086e3d8.zip
r775: merge trunk 774 to samba 3_0 - fix bad compare in for loop
(This used to be commit 3cb8f1d53583dac0b77495cbcd017c366af59891)
Diffstat (limited to 'source3/libsmb/nmblib.c')
-rw-r--r--source3/libsmb/nmblib.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 3c25eba744..51a5671144 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -1143,8 +1143,6 @@ void sort_query_replies(char *data, int n, struct in_addr ip)
qsort(data, n, 6, QSORT_CAST name_query_comp);
}
-#define TRUNCATE_NETBIOS_NAME 1
-
/*******************************************************************
Convert, possibly using a stupid microsoft-ism which has destroyed
the transport independence of netbios (for CIFS vendors that usually
@@ -1164,19 +1162,17 @@ char *dns_to_netbios_name(const char *dns_name)
StrnCpy(netbios_name, dns_name, MAX_NETBIOSNAME_LEN-1);
netbios_name[15] = 0;
-#ifdef TRUNCATE_NETBIOS_NAME
/* ok. this is because of a stupid microsoft-ism. if the called host
name contains a '.', microsoft clients expect you to truncate the
netbios name up to and including the '.' this even applies, by
mistake, to workgroup (domain) names, which is _really_ daft.
*/
- for (i = 0; i >= 15; i--) {
+ for (i = 0; i < 15; i--) {
if (netbios_name[i] == '.') {
netbios_name[i] = 0;
break;
}
}
-#endif /* TRUNCATE_NETBIOS_NAME */
return netbios_name;
}