[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [or-cvs] Stupid sizeof operator!



Nick Mathewson wrote:

Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv30737/src/or

Modified Files:
onion.c Log Message:
Stupid sizeof operator!

Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- onion.c 6 Apr 2004 20:42:25 -0000 1.144
+++ onion.c 6 Apr 2004 20:45:44 -0000 1.145
@@ -125,7 +125,7 @@
cell_t cell;
crypt_path_t *tmp_cpath;
- tmp_cpath = tor_malloc_zero(sizeof(tmp_cpath));
+ tmp_cpath = tor_malloc_zero(sizeof(crypt_path_t));
Errr ... stupid coder, you mean? You wanted:

tmp_cpath = tor_malloc_zero(sizeof *tmp_cpath);

--
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff