diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-11-21 14:34:18 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-11-21 15:32:28 +0400 |
commit | 61f54d2e4a7ae77065ac2249659c2f1a9a0a2cf5 (patch) | |
tree | 33e5453f1c033bdfb87f9eca0402d70e35b4d734 /src/sbuf.c | |
parent | db1fabb719e722f93e0082eb9b7a952bf8afad99 (diff) | |
download | slirp-61f54d2e4a7ae77065ac2249659c2f1a9a0a2cf5.zip slirp-61f54d2e4a7ae77065ac2249659c2f1a9a0a2cf5.tar.gz slirp-61f54d2e4a7ae77065ac2249659c2f1a9a0a2cf5.tar.bz2 |
sbuf: replace a comment with a runtime warning
Let see if it happens, and drop it eventually some day.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'src/sbuf.c')
-rw-r--r-- | src/sbuf.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -16,12 +16,10 @@ bool sbdrop(struct sbuf *sb, int num) { int limit = sb->sb_datalen / 2; - /* - * We can only drop how much we have - * This should never succeed - */ + g_warn_if_fail(num <= sb->sb_cc); if (num > sb->sb_cc) num = sb->sb_cc; + sb->sb_cc -= num; sb->sb_rptr += num; if (sb->sb_rptr >= sb->sb_data + sb->sb_datalen) |