summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-10-07 22:19:36 +0200
committerTyge Løvset <[email protected]>2022-10-07 22:19:36 +0200
commit5fb5ed08250b5ad4eadd6e7a9fdc44f4519b15ff (patch)
tree8fd0bfb5e9f7f062aec7a31ef32aa29a245ab1fc /examples
parent0bb5902e347c6b503c80ba6d6e74dc880b1bc736 (diff)
parent12d854b17371903253cd54e8cbb1a947b637de83 (diff)
downloadSTC-modified-5fb5ed08250b5ad4eadd6e7a9fdc44f4519b15ff.tar.gz
STC-modified-5fb5ed08250b5ad4eadd6e7a9fdc44f4519b15ff.zip
Merge branch 'master' of github.com:tylov/STC
Diffstat (limited to 'examples')
-rw-r--r--examples/books.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/books.c b/examples/books.c
index eed19540..90d2d529 100644
--- a/examples/books.c
+++ b/examples/books.c
@@ -42,8 +42,8 @@ int main()
// Look up the values associated with some keys.
const char* to_find[] = {"Pride and Prejudice", "Alice's Adventure in Wonderland"};
c_forloop (i, c_arraylen(to_find)) {
- const cmap_str_value* b;
- if ((b = cmap_str_get(&book_reviews, to_find[i])))
+ const cmap_str_value* b = cmap_str_get(&book_reviews, to_find[i]);
+ if (b)
printf("%s: %s\n", cstr_str(&b->first), cstr_str(&b->second));
else
printf("%s is unreviewed.\n", to_find[i]);