aboutsummaryrefslogtreecommitdiff
path: root/src/sbuf.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-11-21 14:34:18 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-11-21 15:32:28 +0400
commit61f54d2e4a7ae77065ac2249659c2f1a9a0a2cf5 (patch)
tree33e5453f1c033bdfb87f9eca0402d70e35b4d734 /src/sbuf.c
parentdb1fabb719e722f93e0082eb9b7a952bf8afad99 (diff)
downloadslirp-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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/sbuf.c b/src/sbuf.c
index 71b2ddb..dc5ec6c 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -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)