p = smb_buf(cli->outbuf);
/* this alignment and termination is critical for netapp filers. Don't change */
- p += clistr_align(cli, p, STR_CONVERT);
+ p += clistr_align_out(cli, p, STR_CONVERT);
len = clistr_push(cli, p, fname, -1, STR_CONVERT);
p += len;
SSVAL(cli->outbuf,smb_ntcreate_NameLength, len);
dest_len = sizeof(pstring);
}
- if (clistr_align(cli, dest, flags)) {
+ if (clistr_align_out(cli, dest, flags)) {
*(char *)dest = 0;
dest = (void *)((char *)dest + 1);
dest_len--;
dest_len = sizeof(pstring);
}
- if (clistr_align(cli, src, flags)) {
+ if (clistr_align_in(cli, src, flags)) {
src = (const void *)((const char *)src + 1);
if (src_len > 0) src_len--;
}
if unicode is not negotiated then return 0
otherwise return 1 if offset is off
****************************************************************************/
-int clistr_align(struct cli_state *cli, const void *p, int flags)
+static int clistr_align(struct cli_state *cli, char *buf, const void *p, int flags)
{
if ((flags & STR_NOALIGN) || !UNICODE_FLAG(cli, flags)) return 0;
- return PTR_DIFF(p, cli->outbuf) & 1;
+ return PTR_DIFF(p, buf) & 1;
}
+
+int clistr_align_out(struct cli_state *cli, const void *p, int flags)
+{
+ return clistr_align(cli, cli->outbuf, p, flags);
+}
+
+int clistr_align_in(struct cli_state *cli, const void *p, int flags)
+{
+ return clistr_align(cli, cli->inbuf, p, flags);
+}
+
+