projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] v9fs: v9fs_put_str fix
[deliverable/linux.git]
/
fs
/
9p
/
conv.c
diff --git
a/fs/9p/conv.c
b/fs/9p/conv.c
index 32a9f99154e23b30bb804ba6601b6f804c9baff5..bf1f10067960be8feb075d8740229d1419993b53 100644
(file)
--- a/
fs/9p/conv.c
+++ b/
fs/9p/conv.c
@@
-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);
if (buf_check_size(buf, slen + 2)) {
buf_put_int16(buf, slen);
+ ret = buf->p;
memcpy(buf->p, s, slen);
buf->p += slen;
}
memcpy(buf->p, s, slen);
buf->p += slen;
}
+
+ return ret;
}
static inline void buf_put_string(struct cbuf *buf, const char *s)
}
static inline void buf_put_string(struct cbuf *buf, const char *s)
@@
-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)
{
static void
v9fs_put_str(struct cbuf *bufp, char *data, struct v9fs_str *str)
{
- i
f (data) {
-
str->len = strlen(data)
;
- str->str = bufp->p;
- } else {
-
str->len = 0
;
- str->str = NULL;
- }
+ i
nt 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
}
static int
This page took
0.036515 seconds
and
5
git commands to generate.