Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19649
b: refs/heads/master
c: 05818a0
h: refs/heads/master
i:
  19647: 83e5cae
v: v3
  • Loading branch information
Latchesar Ionkov authored and Linus Torvalds committed Feb 3, 2006
1 parent 8802d6b commit 484acda
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93c615feffbcea4f09ecee154f46062f6041776e
refs/heads/master: 05818a004a84951fd383694f3b35d89eb49fa308
28 changes: 19 additions & 9 deletions trunk/fs/9p/conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,19 @@ static void buf_put_int64(struct cbuf *buf, u64 val)
}
}

static void buf_put_stringn(struct cbuf *buf, const char *s, u16 slen)
static char *buf_put_stringn(struct cbuf *buf, const char *s, u16 slen)
{
char *ret;

ret = NULL;
if (buf_check_size(buf, slen + 2)) {
buf_put_int16(buf, slen);
ret = buf->p;
memcpy(buf->p, s, slen);
buf->p += slen;
}

return ret;
}

static inline void buf_put_string(struct cbuf *buf, const char *s)
Expand Down Expand Up @@ -430,15 +436,19 @@ static inline void v9fs_put_int64(struct cbuf *bufp, u64 val, u64 * p)
static void
v9fs_put_str(struct cbuf *bufp, char *data, struct v9fs_str *str)
{
if (data) {
str->len = strlen(data);
str->str = bufp->p;
} else {
str->len = 0;
str->str = NULL;
}
int len;
char *s;

if (data)
len = strlen(data);
else
len = 0;

buf_put_stringn(bufp, data, str->len);
s = buf_put_stringn(bufp, data, len);
if (str) {
str->len = len;
str->str = s;
}
}

static int
Expand Down

0 comments on commit 484acda

Please sign in to comment.