Handout
This commit is contained in:
11
kernel/object/stringbuffer.cc
Normal file
11
kernel/object/stringbuffer.cc
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "stringbuffer.h"
|
||||
|
||||
void Stringbuffer::put(char c) {
|
||||
if (pos < (sizeof(buffer) - 1)) {
|
||||
buffer[pos++] = c;
|
||||
buffer[pos] = '\0';
|
||||
}
|
||||
if (pos >= (sizeof(buffer) - 1)) {
|
||||
flush();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user