Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zlib code examples. #3113

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -50,7 +50,7 @@ Let's have a look at the *main.c* file:
char buffer_in [256] = {"Conan is a MIT-licensed, Open Source package manager for C and C++ development "
"for C and C++ development, allowing development teams to easily and efficiently "
"manage their packages and dependencies across platforms and build systems."};
char buffer_out [256] = {0};
unsigned char buffer_out [256] = {0};

z_stream defstream;
defstream.zalloc = Z_NULL;
Expand All @@ -65,8 +65,8 @@ Let's have a look at the *main.c* file:
deflate(&defstream, Z_FINISH);
deflateEnd(&defstream);

printf("Uncompressed size is: %lu\n", strlen(buffer_in));
printf("Compressed size is: %lu\n", strlen(buffer_out));
printf("Uncompressed size is: %zu\n", strlen(buffer_in));
printf("Compressed size is: %lu\n", defstream.total_out);

printf("ZLIB VERSION: %s\n", zlibVersion());

Expand Down
6 changes: 3 additions & 3 deletions tutorial/consuming_packages/build_simple_cmake_project.rst
Expand Up @@ -48,7 +48,7 @@ Let's have a look at the *main.c* file:
char buffer_in [256] = {"Conan is a MIT-licensed, Open Source package manager for C and C++ development "
"for C and C++ development, allowing development teams to easily and efficiently "
"manage their packages and dependencies across platforms and build systems."};
char buffer_out [256] = {0};
unsigned char buffer_out [256] = {0};

z_stream defstream;
defstream.zalloc = Z_NULL;
Expand All @@ -63,8 +63,8 @@ Let's have a look at the *main.c* file:
deflate(&defstream, Z_FINISH);
deflateEnd(&defstream);

printf("Uncompressed size is: %lu\n", strlen(buffer_in));
printf("Compressed size is: %lu\n", strlen(buffer_out));
printf("Uncompressed size is: %zu\n", strlen(buffer_in));
printf("Compressed size is: %lu\n", defstream.total_out);

printf("ZLIB VERSION: %s\n", zlibVersion());

Expand Down