diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-08-09 18:46:45 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-08-09 18:46:45 -0700 |
commit | 6f2cfc118701b59d96862199204aef7834f9db86 (patch) | |
tree | afce2dc865458796912962cdab288699617de730 /client/libacron/README.md | |
parent | 7edaa14c2c822e5b776edaa6534753b258d29488 (diff) | |
download | acron-6f2cfc118701b59d96862199204aef7834f9db86.tar acron-6f2cfc118701b59d96862199204aef7834f9db86.tar.gz acron-6f2cfc118701b59d96862199204aef7834f9db86.tar.bz2 acron-6f2cfc118701b59d96862199204aef7834f9db86.zip |
fix(libacron/acronc/helloworld): ac_receive: 'read' should be the delta value of bytes read in the call, not the absolute position
Also clearify that 'read' is undefined if the function fails.
Diffstat (limited to 'client/libacron/README.md')
-rw-r--r-- | client/libacron/README.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/libacron/README.md b/client/libacron/README.md index 736b44a..bc7e879 100644 --- a/client/libacron/README.md +++ b/client/libacron/README.md @@ -215,9 +215,10 @@ size_t read; while (1) { if ((r = ac_receive(connection, buffer, pos, len, &obj, &read))) { /* Handle error. */ + /* read is undefined. */ break; } - pos += read; + pos += read; /* read is the bytes read in the last call. */ /* The obj is now referencing to a library allocated event or response. */ /* Do things with the event or response. */ ac_obj_free(obj); |