version 1.34, 2009/04/18 14:58:07
|
version 1.35, 2010/07/12 02:58:01
|
Line 96 char *
|
Line 96 char *
|
smb_strdup(const char *s) |
smb_strdup(const char *s) |
{ |
{ |
char *p; |
char *p; |
int len; |
size_t len; |
|
|
len = s ? strlen(s) + 1 : 1; |
len = s ? strlen(s) + 1 : 1; |
p = malloc(len, M_SMBSTR, M_WAITOK); |
p = malloc(len, M_SMBSTR, M_WAITOK); |
Line 111 smb_strdup(const char *s)
|
Line 111 smb_strdup(const char *s)
|
* duplicate string from a user space. |
* duplicate string from a user space. |
*/ |
*/ |
char * |
char * |
smb_strdupin(char *s, int maxlen) |
smb_strdupin(char *s, size_t maxlen) |
{ |
{ |
char *p, bt; |
char *p, bt; |
int len = 0; |
size_t len = 0; |
|
|
for (p = s; ;p++) { |
for (p = s; ;p++) { |
if (copyin(p, &bt, 1)) |
if (copyin(p, &bt, 1)) |
Line 134 smb_strdupin(char *s, int maxlen)
|
Line 134 smb_strdupin(char *s, int maxlen)
|
* duplicate memory block from a user space. |
* duplicate memory block from a user space. |
*/ |
*/ |
void * |
void * |
smb_memdupin(void *umem, int len) |
smb_memdupin(void *umem, size_t len) |
{ |
{ |
char *p; |
char *p; |
|
|
Line 160 smb_memfree(void *s)
|
Line 160 smb_memfree(void *s)
|
} |
} |
|
|
void * |
void * |
smb_zmalloc(unsigned long size, struct malloc_type *type, int flags) |
smb_zmalloc(size_t size, struct malloc_type *type, int flags) |
{ |
{ |
|
|
return malloc(size, type, flags | M_ZERO); |
return malloc(size, type, flags | M_ZERO); |
Line 179 smb_strtouni(u_int16_t *dst, const char
|
Line 179 smb_strtouni(u_int16_t *dst, const char
|
void |
void |
m_dumpm(struct mbuf *m) { |
m_dumpm(struct mbuf *m) { |
char *p; |
char *p; |
int len; |
size_t len; |
printf("d="); |
printf("d="); |
while(m) { |
while(m) { |
p=mtod(m,char *); |
p = mtod(m,char *); |
len=m->m_len; |
len = m->m_len; |
printf("(%d)",len); |
printf("(%zu)", len); |
while(len--){ |
while(len--){ |
printf("%02x ",((int)*(p++)) & 0xff); |
printf("%02x ",((int)*(p++)) & 0xff); |
} |
} |
Line 315 smb_copy_iconv(struct mbchain *mbp, cons
|
Line 315 smb_copy_iconv(struct mbchain *mbp, cons
|
|
|
int |
int |
smb_put_dmem(struct mbchain *mbp, struct smb_vc *vcp, const char *src, |
smb_put_dmem(struct mbchain *mbp, struct smb_vc *vcp, const char *src, |
int size, int caseopt) |
size_t size, int caseopt) |
{ |
{ |
struct iconv_drv *dp = vcp->vc_toserver; |
struct iconv_drv *dp = vcp->vc_toserver; |
|
|