chiark
/
gitweb
/
~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import release 0.07
[secnet]
/
util.c
diff --git
a/util.c
b/util.c
index 19293834dc635c91c1a9db21d640090aab1a8af8..c652537704333f55ded4eb8890ece6f29d0d7f2b 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-15,12
+15,13
@@
#include <errno.h>
#include <syslog.h>
#include <unistd.h>
#include <errno.h>
#include <syslog.h>
#include <unistd.h>
-#include <
value
s.h>
+#include <
limit
s.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "util.h"
#include "secnet.h"
#include <assert.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "util.h"
#include "secnet.h"
+#include "unaligned.h"
#define MIN_BUFFER_SIZE 64
#define DEFAULT_BUFFER_SIZE 4096
#define MIN_BUFFER_SIZE 64
#define DEFAULT_BUFFER_SIZE 4096
@@
-522,7
+523,7
@@
void buf_append_string(struct buffer_if *buf, string_t s)
uint16_t len;
len=strlen(s);
uint16_t len;
len=strlen(s);
-
*(uint16_t *)buf_append(buf,2)=htons(
len);
+
buf_append_uint16(buf,
len);
memcpy(buf_append(buf,len),s,len);
}
memcpy(buf_append(buf,len),s,len);
}