Author: jerry
Date: 2006-01-30 17:42:42 +0000 (Mon, 30 Jan 2006)
New Revision: 13231

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13231

Log:
apparently strncat() is converted to strcat() on RH7.3 and similar systems.  
Fix the build on those boxes
Modified:
   branches/SAMBA_3_0/source/lib/version.c
   branches/SAMBA_3_0_RELEASE/source/lib/version.c
   trunk/source/lib/version.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/version.c
===================================================================
--- branches/SAMBA_3_0/source/lib/version.c     2006-01-30 14:34:58 UTC (rev 
13230)
+++ branches/SAMBA_3_0/source/lib/version.c     2006-01-30 17:42:42 UTC (rev 
13231)
@@ -29,6 +29,7 @@
        static fstring samba_version;
        fstring tmp_version;
        static BOOL init_samba_version;
+       size_t remaining;
 
        if (init_samba_version)
                return samba_version;
@@ -38,8 +39,9 @@
                SAMBA_VERSION_VENDOR_SUFFIX);
 
 #ifdef SAMBA_VENDOR_PATCH
-       fstr_sprintf( tmp_version, "-%d", SAMBA_VENDOR_PATCH );
-       fstrcat( samba_version, tmp_version );
+       remaining = sizeof(samba_version)-strlen(samba_version);
+       snprintf( tmp_version, sizeof(tmp_version),  "-%d", SAMBA_VENDOR_PATCH 
);
+       strlcat( samba_version, tmp_version, remaining-1 );
 #endif
 
        init_samba_version = True;

Modified: branches/SAMBA_3_0_RELEASE/source/lib/version.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/lib/version.c     2006-01-30 14:34:58 UTC 
(rev 13230)
+++ branches/SAMBA_3_0_RELEASE/source/lib/version.c     2006-01-30 17:42:42 UTC 
(rev 13231)
@@ -41,7 +41,7 @@
 #ifdef SAMBA_VENDOR_PATCH
        remaining = sizeof(samba_version)-strlen(samba_version);
        snprintf( tmp_version, sizeof(tmp_version),  "-%d", SAMBA_VENDOR_PATCH 
);
-       strncat( samba_version, tmp_version, remaining );
+       strlcat( samba_version, tmp_version, remaining-1 );
 #endif
 
        init_samba_version = True;

Modified: trunk/source/lib/version.c
===================================================================
--- trunk/source/lib/version.c  2006-01-30 14:34:58 UTC (rev 13230)
+++ trunk/source/lib/version.c  2006-01-30 17:42:42 UTC (rev 13231)
@@ -29,6 +29,7 @@
        static fstring samba_version;
        fstring tmp_version;
        static BOOL init_samba_version;
+       size_t remaining;
 
        if (init_samba_version)
                return samba_version;
@@ -38,8 +39,9 @@
                SAMBA_VERSION_VENDOR_SUFFIX);
 
 #ifdef SAMBA_VENDOR_PATCH
-       fstr_sprintf( tmp_version, "-%d", SAMBA_VENDOR_PATCH );
-       fstrcat( samba_version, tmp_version );
+       remaining = sizeof(samba_version)-strlen(samba_version);
+       snprintf( tmp_version, sizeof(tmp_version),  "-%d", SAMBA_VENDOR_PATCH 
);
+       strlcat( samba_version, tmp_version, remaining-1 );
 #endif
 
        init_samba_version = True;

Reply via email to