* removes @count integers from the end of the packet * * @return: * 0: success * < 0: error, no more integers in buffer */
| 231 | * < 0: error, no more integers in buffer |
| 232 | */ |
| 233 | int bin_remove_int_buffer_end(bin_packet_t *packet, int count) |
| 234 | { |
| 235 | if (!packet->buffer.s || !packet->size || |
| 236 | (int)(packet->buffer.len - count * sizeof(int)) < 0){ |
| 237 | LM_ERR("binary packet underflow\n"); |
| 238 | return -1; |
| 239 | } |
| 240 | |
| 241 | packet->buffer.len -= count * sizeof(int); |
| 242 | |
| 243 | set_len(packet); |
| 244 | return 0; |
| 245 | } |
| 246 | |
| 247 | /* |
| 248 | * skips @count integers in the end of the packet |
no test coverage detected