16 Commits
Author SHA1 Message Date
Thiago Macieira ef6f92349f simplereader: Fix warning about use of pointer variable after free()
We weren't dereferencing the variable, so this should have been safe.
However, it isn't clear in the C and C++ standards whether it
legitimately was safe. So let's just fix it.

```
simplereader.c:180:9: warning: pointer ‘buf’ may be used after ‘free’ [-Wuse-after-free]
simplereader.c:177:5: note: call to ‘free’ here
```

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2026-02-05 14:09:42 -08:00
Thiago Macieira 7b607eb5e8 Remove the old Makefile and qmake buildsystem files
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2025-03-18 17:14:19 -07:00
linraymond2006 1bcde8771b Use cbor_value_get_next_byte instead of accessing structure directly
Signed-off-by: linraymond2006 <linraymond2006@gmail.com>
2025-01-22 09:22:10 -08:00
LinRaymond2006 aa86c9d08e Corrected syntax error in examples/simplereader.c 2025-01-22 09:22:10 -08:00
Thiago Macieira 5115a87bc7 Merge commit 'refs/pull/177/head' of github.com:intel/tinycbor 2021-09-03 11:29:44 -07:00
Mahavir Jain 7c349dbb6b Add checks for memory allocation failures
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2021-02-24 21:30:37 -03:00
Svyatoslav Phirsov 1a43b45ed9 string pretty-print improved
string got plain old C output format to avoid confusion e.g. "true" string with CBOR true value

Signed-off-by: phirsov <41143811+phirsov@users.noreply.github.com>
2020-02-09 17:52:42 +03:00
Svyatoslav Phirsov 8acb09f5b0 bytestring output pretty-print improved
bytestring got escaped hex string literal output format to not to confuse e.g. "\x11" bytestring with 11 integer

Signed-off-by: phirsov <41143811+phirsov@users.noreply.github.com>
2020-02-09 17:51:07 +03:00
Svyatoslav Phirsov 722f6496c3 indentation typo fixed
printf s.b. used for indentation because no newline at end is needed

Signed-off-by: phirsov <41143811+phirsov@users.noreply.github.com>
2020-02-09 17:49:31 +03:00
Svyatoslav Phirsov 467b0ebc55 check app arguments in more strict manner
Signed-off-by: phirsov <41143811+phirsov@users.noreply.github.com>
2020-02-09 17:30:20 +03:00
Svyatoslav Phirsov 1db99f95f2 typo in dumprecursive return type
should be CborErrorr rather than bool
2018-10-23 10:47:40 -07:00
Svyatoslav Phirsov 2b267847ef Typo fixed in stdlib fread(...) usage
fread(...) function returns the number of items read so far, not number of bytes, ergo, reading one st.st_size sized item produces 1 on success and 0 on failure.
Possibly fixing issue #77

Signed-off-by: phirsov <41143811+phirsov@users.noreply.github.com>
2018-10-13 16:26:48 -07:00
Thiago Macieira ddd99e434c Fix the simplereader example after the API change a while ago
We changed a lot of "char*" that was binary to "uint8_t*". The example
was never fixed.

This fixes #23.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-12 10:55:57 -07:00
Thiago Macieira a43a4efc8d Make the CBOR decoder API begin to work
This commit also starts to add unit tests.

The API, as tested, works. The simplereader.c example is probably broken
and will be fixed later.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-12 17:45:36 +09:00
Thiago Macieira 2312efd7ca Add more API for decoding CBOR
This version compiles but does not work yet.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-12 17:45:36 +09:00
Thiago Macieira 54a0e10871 Initial import of the sources to do CBOR parsing
This code was originally part of a contribution to QtCore, see:
     https://codereview.qt-project.org/107465
     https://codereview.qt-project.org/107466

This version does not compile nor work yet.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-12 17:45:36 +09:00