News for hackers. Stuff that matters.
Re:Ask HN: What's the worst piece of code you've ever seen? by Gibbon1 on Sunday January 31, 2016 @01:40AM (#11005512)
This gem from today is pretty icky

  TEST_PACKET_T *xmt_buffer = (TEST_PACKET_T *) radio_drv_cntl->xmt_buffer;

  ...
  ...
  uint8_t msg_len = xmt_buffer->len;
  // Fill the payload with 'data'
  for(uint8_t indx=offsetof(TEST_PACKET_T, data); indx<msg_len-2; indx++)
    xmt_buffer->data[indx] = indx;

There are no comments on this comment yet.