From 2b3c44e4fb980335c22abcc07a88f32b13e5918f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 10 Nov 2007 22:31:34 -0800 Subject: Always define PATH_MAX. Makes code simpler (removes a bunch of #defines). Remove pstring from msdfs.c. Jeremy. (This used to be commit e203ba22275320808bc11b17361ad1f2d5b0b897) --- source3/lib/replace/replace.h | 4 ++++ source3/lib/system.c | 4 ---- source3/lib/util_unistr.c | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/replace/replace.h b/source3/lib/replace/replace.h index 973c68ee14..36a355f0a9 100644 --- a/source3/lib/replace/replace.h +++ b/source3/lib/replace/replace.h @@ -536,4 +536,8 @@ typedef int bool; #define QSORT_CAST (int (*)(const void *, const void *)) #endif +#ifndef PATH_MAX +#define PATH_MAX 1024 +#endif + #endif /* _LIBREPLACE_REPLACE_H */ diff --git a/source3/lib/system.c b/source3/lib/system.c index 321bca83bb..7338ea7750 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -573,11 +573,7 @@ char *sys_getwd(char *s) { char *wd; #ifdef HAVE_GETCWD -#ifdef PATH_MAX wd = (char *)getcwd(s, PATH_MAX); -#else - wd = (char *)getcwd(s, sizeof (pstring)); -#endif #else wd = (char *)getwd(s); #endif diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index e9e2c33fb3..c4569e102e 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -350,11 +350,20 @@ char *rpcstr_pull_unistr2_talloc(TALLOC_CTX *mem_ctx, const UNISTR2 *src) /* Converts a string from internal samba format to unicode */ -int rpcstr_push(void* dest, const char *src, size_t dest_len, int flags) +int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags) { return push_ucs2(NULL, dest, src, dest_len, flags|STR_UNICODE|STR_NOALIGN); } +/* Converts a string from internal samba format to unicode. Always terminates. + * Actually just a wrapper round push_ucs2_talloc(). + */ + +int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src) +{ + return push_ucs2_talloc(ctx, dest, src); +} + /******************************************************************* Convert a (little-endian) UNISTR2 structure to an ASCII string. ********************************************************************/ -- cgit