Because Pelle added _vsnwprintf() to his libc.lib I have been able to add the wide char functions for str_asprintf() - these functions allocate the destination buffer, also added str_ccat.
Functions added
long str_ccat(char* pszDest, size_t cchDest, int numargs, ...);
long str_ccatx(char* pszDest, size_t cchDest, size_t* pLength, int numargs, ...);
long str_asprintf(char ** pszDest, const char* pszFormat, ...);
long str_asprintfx(char ** pszDest, size_t * pLength, const char* pszFormat, ...);
WideChar equivalents
long str_wccat(wchar_t* pszDest, size_t cchDest, int numargs, ...);
long str_wccatx(wchar_t* pszDest, size_t cchDest, size_t* pLength, int numargs, ...);
long str_aswprintf(wchar_t ** pszDest, const wchar_t* pszFormat, ...);
long str_aswprintfx(wchar_t ** pszDest, size_t * pLength, const wchar_t* pszFormat, ...);
=====================
str_ccat() will concatenate any number of null terminated strings. This is more efficient than using either str_sprintf or multiple calls to str_cat.
str_asprintf() allocates the required memory from the heap for the destination buffer, the buffer must be free-ed by the user.
As with all functions in this library (except str_asprintf) the destination size is passed making buffer overruns not possible - the 'X' functions will return the final size in pLength.
[can't find the attachment feature]
http://www.btinternet.com/~john.findlay1/Strlib.zip
John
Nice! Thanks!
The attachment feature *should* be there. Vortex have had some problems too. It works for me (because I'm the Administrator?).
Pelle
Well, It disappears on my end too. :?:
I, as well, can not see the Attachments portion of the Post a Reply box. The last thing above the Preview and Submit buttons is the "Notify me when a reply is posted" checkbox.
I am logged in.
Robert Wishlaw
It should work now.
Pelle
Quote from: "Pelle"It should work now.
Pelle
Thanks, trying with strlib.zip
Seems to be ok now.
John
Great. A typical case of RTFM.
Pelle
Quote from: "Pelle"Great. A typical case of RTFM.
Pelle
:)
Images and attachments only for logged in users, is that right?
John
Quote from: "JohnF"Quote from: "Pelle"Great. A typical case of RTFM.
Pelle
:)
Images and attachments only for logged in users, is that right?
John
On this forum, a reply can not be posted unless logged in.
The attachment dialog is now functioning as expected.
Thank you.
Robert Wishlaw
The problem was with the per forum permission settings. They can be viewed in 'simple' or 'advanced' mode. The 'advanced' mode contains (in my opinion) too much information, so at one point I switched to 'simple' mode. This changed the permissions for attachments to 'administrator' (or something like that). Probably because the attachment feature is not part of the base package (add-on). Not so easy to figure out...
Pelle
Quote from: "Pelle"The problem was with the per forum permission settings. They can be viewed in 'simple' or 'advanced' mode. The 'advanced' mode contains (in my opinion) too much information, so at one point I switched to 'simple' mode. This changed the permissions for attachments to 'administrator' (or something like that). Probably because the attachment feature is not part of the base package (add-on). Not so easy to figure out...
Pelle
It's not important for me - I was wondering you you wanted it that way.
John
At least for 'Bug reports' and 'Feature requests' I prefer to have something other than 'guest'. Maybe I should remove the requirement to log in for the other forums...?
Pelle
Quote from: "Pelle"At least for 'Bug reports' and 'Feature requests' I prefer to have something other than 'guest'. Maybe I should remove the requirement to log in for the other forums...?
Pelle
Yes, that is probably the right way to go.
John
Updated strlib.zip
Bug found in str_ccat and family
added code to trap another possible overrun.
// go to the end of the dest string
while(*pszDest)
{
pszDest++;
cchDest--;
if(cchDest == 0)
return STR_E_INSUFFICIENT_BUFFER;
}
John