Skip to content

Commit

Permalink
Copy structs without memcpy.
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Nelson Elhage <nelhage@mit.edu>
  • Loading branch information
andersk committed Mar 8, 2010
1 parent 46d940a commit 66a8cd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion message.c
Expand Up @@ -750,7 +750,7 @@ void owl_message_create_from_znotice(owl_message *m, const ZNotice_t *n)
owl_message_set_direction_in(m);

/* first save the full notice */
memcpy(&(m->notice), n, sizeof(ZNotice_t));
m->notice = *n;

/* a little gross, we'll replace \r's with ' ' for now */
owl_zephyr_hackaway_cr(&(m->notice));
Expand Down
2 changes: 1 addition & 1 deletion messagelist.c
Expand Up @@ -84,7 +84,7 @@ int owl_messagelist_expunge(owl_messagelist *ml)
owl_list_cleanup(&(ml->list), NULL);

/* copy the new list to the old list */
memcpy(&(ml->list), &newlist, sizeof(owl_list));
ml->list = newlist;

return(0);
}
Expand Down
2 changes: 1 addition & 1 deletion variable.c
Expand Up @@ -465,7 +465,7 @@ int owl_variable_dict_setup(owl_vardict *vd) {
if (owl_dict_create(vd)) return(-1);
for (var = variables_to_init; var->name != NULL; var++) {
cur = owl_malloc(sizeof(owl_variable));
memcpy(cur, var, sizeof(owl_variable));
*cur = *var;
switch (cur->type) {
case OWL_VARIABLE_OTHER:
cur->set_fn(cur, cur->pval_default);
Expand Down

0 comments on commit 66a8cd6

Please sign in to comment.