}
 
   }
 
#endif /* DEBUG_LEVEL */
 
#endif /* DEBUG_LEVEL */
   memcpy(to, packetbuf + hdrptr, PACKETBUF_HDR_SIZE - hdrptr);
+
   memcpy(to, packetbuf + hdrptr, PACKETBUF_HDR_SIZE - hdrptr);//packetbuf points to the beginning of the buffer array.
 
   return PACKETBUF_HDR_SIZE - hdrptr;
 
   return PACKETBUF_HDR_SIZE - hdrptr;
 
}
 
}
 
In the above potion of code, the main line is the following
 
In the above potion of code, the main line is the following
 
  memcpy(to, packetbuf + hdrptr, PACKETBUF_HDR_SIZE - hdrptr);
 
  memcpy(to, packetbuf + hdrptr, PACKETBUF_HDR_SIZE - hdrptr);
Exception encountered, of type "Error"