summaryrefslogtreecommitdiffstats
path: root/source3/libsmb/cliquota.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-11 15:50:16 +0100
committerJeremy Allison <jra@samba.org>2007-11-11 13:16:58 -0800
commit63d141d4e8b6fa0977b9b89545e9cf8bc694f416 (patch)
tree302d45ed551e0692b7ffb1e7d98e00a801e6e911 /source3/libsmb/cliquota.c
parent50d9b94f6f7762fb4a86b020af461553422a71ad (diff)
downloadsamba-63d141d4e8b6fa0977b9b89545e9cf8bc694f416.tar.gz
samba-63d141d4e8b6fa0977b9b89545e9cf8bc694f416.tar.xz
samba-63d141d4e8b6fa0977b9b89545e9cf8bc694f416.zip
Remove a static fstring
Feel free to push :-) Volker (This used to be commit f213556f50de4a28b5c5d2e1e762013837feb722)
Diffstat (limited to 'source3/libsmb/cliquota.c')
-rw-r--r--source3/libsmb/cliquota.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c
index 1932c044e28..690da5928c9 100644
--- a/source3/libsmb/cliquota.c
+++ b/source3/libsmb/cliquota.c
@@ -562,26 +562,26 @@ cleanup:
return ret;
}
-static char *quota_str_static(SMB_BIG_UINT val, bool special, bool _numeric)
+static const char *quota_str_static(SMB_BIG_UINT val, bool special, bool _numeric)
{
- static fstring buffer;
-
- memset(buffer,'\0',sizeof(buffer));
+ const char *result;
if (!_numeric&&special&&(val == SMB_NTQUOTAS_NO_LIMIT)) {
- fstr_sprintf(buffer,"NO LIMIT");
- return buffer;
+ return "NO LIMIT";
}
#if defined(HAVE_LONGLONG)
- fstr_sprintf(buffer,"%llu",val);
+ result = talloc_asprintf(talloc_tos(), "%llu", val);
#else
- fstr_sprintf(buffer,"%lu",val);
-#endif
- return buffer;
+ result = talloc_asprintf(talloc_tos(), "%lu", val);
+#endif
+ SMB_ASSERT(result != NULL);
+ return result;
}
void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))
{
+ TALLOC_CTX *frame = talloc_stackframe();
+
if (!qt) {
smb_panic("dump_ntquota() called with NULL pointer");
}
@@ -626,8 +626,9 @@ void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_
break;
default:
d_printf("dump_ntquota() invalid qtype(%d)\n",qt->qtype);
- return;
}
+ TALLOC_FREE(frame);
+ return;
}
void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric))