title: Removing node from singly linked list
body: <p>I need to remove a node from a singly linked list. I know this is a simple thing to do, but my mind is blank and I've searched both Google and Stackoverflow, but I seriously haven't found anything that will help me.</p>
  
  <p>basically the list of nodes is contained in a bucket; like this:</p>
  
  <pre><code>struct node{
    unsigned char id[20];
    struct node *next;
  };
  
  struct bucket{
    unsigned char id;
    struct node *nodes;
  };
  </code></pre>
  
  <p>and I have a function</p>
  
  <pre><code>struct bucket *dht_bucketfind(unsigned char *id);  // return bucket with id[20]
  </code></pre>
  
  <p>to find the correct bucket. So I know how to find the correct bucket, but I don't know how to remove a given node. I would like to remove the node by nodeid (I think, I haven't really written the code that will call the remove function yet ;) but I think I'll be able to modify the code if necessary). I think that's all that's needed to solve this. Thanks in advance.</p>