diff options
| author | Patrick | 2023-06-19 21:21:16 +0200 |
|---|---|---|
| committer | Patrick | 2023-06-19 21:21:16 +0200 |
| commit | ad9d01050b7b6d592a83ce14eeef7068bd981028 (patch) | |
| tree | f6263c85f4c9905bccb1887e50d2777c61b24405 /src/fixedbuffer.c | |
| parent | d382d193cb2d550cc769afa76e55823865a39023 (diff) | |
| download | matrix_esp_thesis-ad9d01050b7b6d592a83ce14eeef7068bd981028.tar.gz matrix_esp_thesis-ad9d01050b7b6d592a83ce14eeef7068bd981028.zip | |
olm session management
Diffstat (limited to 'src/fixedbuffer.c')
| -rw-r--r-- | src/fixedbuffer.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/fixedbuffer.c b/src/fixedbuffer.c deleted file mode 100644 index ad99897..0000000 --- a/src/fixedbuffer.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "fixedbuffer.h"
-
-#include <string.h>
-
-FixedBuffer
-FixedBuf(const char * str)
-{
- int len = strlen(str);
- FixedBuffer result;
- result.ptr = (char *)str;
- result.cap = len;
- result.len = len;
- return result;
-}
-
-bool
-FixedBufferToInt(FixedBuffer fb, int * outInt)
-{
- bool valid = false;
- int result = 0;
-
- bool negative = false;
-
- for (int i = 0; i < fb.len; i++)
- {
- if (i == 0 && fb.ptr[i] == '-')
- {
- negative = true;
- continue;
- }
-
- int val = fb.ptr[i] - '0';
- if (val < 0 || val > 9)
- return false;
-
- result *= 10;
- result += val;
- valid = true;
- }
-
- *outInt = result;
- return valid;
-}
\ No newline at end of file |
