diff options
Diffstat (limited to 'paste.c')
-rw-r--r-- | paste.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: paste.c,v 1.8 2009-07-31 20:33:49 tcunha Exp $ */ +/* $Id: paste.c,v 1.9 2009-09-07 23:48:54 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -97,7 +97,7 @@ paste_free_index(struct paste_stack *ps, u_int idx) } void -paste_add(struct paste_stack *ps, char *data, u_int limit) +paste_add(struct paste_stack *ps, u_char *data, size_t size, u_int limit) { struct paste_buffer *pb; @@ -115,12 +115,13 @@ paste_add(struct paste_stack *ps, char *data, u_int limit) ARRAY_INSERT(ps, 0, pb); pb->data = data; + pb->size = size; if (gettimeofday(&pb->tv, NULL) != 0) fatal("gettimeofday"); } int -paste_replace(struct paste_stack *ps, u_int idx, char *data) +paste_replace(struct paste_stack *ps, u_int idx, u_char *data, size_t size) { struct paste_buffer *pb; @@ -131,6 +132,7 @@ paste_replace(struct paste_stack *ps, u_int idx, char *data) xfree(pb->data); pb->data = data; + pb->size = size; if (gettimeofday(&pb->tv, NULL) != 0) fatal("gettimeofday"); |