diff --git a/sflphone-common/src/audio/ringbuffer.cpp b/sflphone-common/src/audio/ringbuffer.cpp
index 38392b6f26924713671fed0c0cb45e56d5aa9c6f..e0d2c505c1948133e09235860343b271b538f7ef 100644
--- a/sflphone-common/src/audio/ringbuffer.cpp
+++ b/sflphone-common/src/audio/ringbuffer.cpp
@@ -99,7 +99,7 @@ RingBuffer::getLen(CallID call_id)
 
     int length = (mEnd + mBufferSize - mStart) % mBufferSize;
     // _debug("    *RingBuffer::getLen: buffer_id %s, call_id %s, mStart %i, mEnd %i, length %i, buffersie %i\n", buffer_id.c_str(), call_id.c_str(), mStart, mEnd, length, mBufferSize);
-    return (mEnd + mBufferSize - mStart) % mBufferSize;
+    return length;
 
 }
 
diff --git a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
index 900c466eff9fc225db793fbfa9537d5ee1bd5d70..dee07b35b5edb96ac231477a014b9a627b4a881d 100644
--- a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
+++ b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp
@@ -477,7 +477,7 @@ void AudioRecord::recData (SFLDataFormat* buffer, int nSamples)
 
 
         if (sndFormat_ == INT16) {   // TODO change INT16 to SINT16
-            if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != nSamples)
+            if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != (unsigned int)nSamples)
                 _debug ("AudioRecord: Could not record data! \n");
             else {
                 fflush (fp);