summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-09-26 19:26:56 +0000
committerJeremy Allison <jra@samba.org>1997-09-26 19:26:56 +0000
commitdff16872ca39c007d32d114af82d3ccd97f9d47a (patch)
tree503e542b459992e3c61945e9f8e5defe273a86f6 /source3/lib
parentd939350de407db97422cb22ef885afed3fdf7cea (diff)
downloadsamba-dff16872ca39c007d32d114af82d3ccd97f9d47a.tar.gz
samba-dff16872ca39c007d32d114af82d3ccd97f9d47a.tar.bz2
samba-dff16872ca39c007d32d114af82d3ccd97f9d47a.zip
Syncing up current oplock work in progress. #ifdef'ed out
so should have no effect on other work. Jeremy (jallison@whistle.com) (This used to be commit 7e3d4c8b21f63a06d32605d230129e36883ad08c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c75
1 files changed, 37 insertions, 38 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8ffc11068a..05dd619813 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -4061,53 +4061,52 @@ enum remote_arch_types get_remote_arch()
return ra_type;
}
-
/*******************************************************************
safe string copy into a fstring
********************************************************************/
void fstrcpy(char *dest, char *src)
{
- int maxlength = sizeof(fstring) - 1;
- if (!dest) {
- DEBUG(0,("ERROR: NULL dest in fstrcpy\n"));
- return;
- }
-
- if (!src) {
- *dest = 0;
- return;
- }
+ int maxlength = sizeof(fstring) - 1;
+ if (!dest) {
+ DEBUG(0,("ERROR: NULL dest in fstrcpy\n"));
+ return;
+ }
- while (maxlength-- && *src)
- *dest++ = *src++;
- *dest = 0;
- if (*src) {
- DEBUG(0,("ERROR: string overflow by %d in fstrcpy\n",
- strlen(src)));
- }
-}
+ if (!src) {
+ *dest = 0;
+ return;
+ }
+
+ while (maxlength-- && *src)
+ *dest++ = *src++;
+ *dest = 0;
+ if (*src) {
+ DEBUG(0,("ERROR: string overflow by %d in fstrcpy\n",
+ strlen(src)));
+ }
+}
/*******************************************************************
safe string copy into a pstring
********************************************************************/
void pstrcpy(char *dest, char *src)
{
- int maxlength = sizeof(pstring) - 1;
- if (!dest) {
- DEBUG(0,("ERROR: NULL dest in pstrcpy\n"));
- return;
- }
-
- if (!src) {
- *dest = 0;
- return;
- }
-
- while (maxlength-- && *src)
- *dest++ = *src++;
- *dest = 0;
- if (*src) {
- DEBUG(0,("ERROR: string overflow by %d in pstrcpy\n",
- strlen(src)));
- }
-}
+ int maxlength = sizeof(pstring) - 1;
+ if (!dest) {
+ DEBUG(0,("ERROR: NULL dest in pstrcpy\n"));
+ return;
+ }
+
+ if (!src) {
+ *dest = 0;
+ return;
+ }
+
+ while (maxlength-- && *src)
+ *dest++ = *src++;
+ *dest = 0;
+ if (*src) {
+ DEBUG(0,("ERROR: string overflow by %d in pstrcpy\n",
+ strlen(src)));
+ }
+}