compilation warning

untitled.c:70:9: warning: enumeration value 'OK' not handled in switch
      [-Wswitch]
        switch(err) {
or on second thought, maybe change this function to handle all return values and return `true` or `false`