]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tossim/sim_noise.c
Trim the size down a bit.
[tinyos-2.x.git] / tos / lib / tossim / sim_noise.c
index 6614cc9c0c36682e6d573560ca2e9456d4e185e4..6a5dca745ed6679ae7a78d3f9aaade432f125783 100644 (file)
@@ -221,15 +221,9 @@ void sim_noise_dist(uint16_t node_id)__attribute__ ((C, spontaneous))
 
 void arrangeKey(uint16_t node_id)__attribute__ ((C, spontaneous))
 {
-  int i;
-  char key[NOISE_HISTORY];
   char *pKey = noiseData[node_id].key;
+  memcpy(pKey, pKey+1, NOISE_HISTORY-1);
 
-  for(i=0;i<NOISE_HISTORY-1; i++)
-    {
-      key[i] = pKey[i+1];
-    }
-  memcpy((void *)pKey, (void *)key, NOISE_HISTORY);
 }
 
 /*