Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c

Issue 22842011: [NaCl SDK] Remove invalid assert from nacl_io. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c
diff --git a/native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c b/native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c
index c38fefc368194b03c9ccdfa3414d25010d283414..ff2489603dc88c3652a4b076626c80985b149b74 100644
--- a/native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c
+++ b/native_client_sdk/src/examples/demo/nacl_io/nacl_io_demo.c
@@ -86,7 +86,10 @@ char* VprintfToNewString(const char* format, va_list args) {
length = vsnprintf(NULL, 0, format, args);
buffer = (char*)malloc(length + 1); /* +1 for NULL-terminator. */
result = vsnprintf(&buffer[0], length + 1, format, args_copy);
- assert(result == length);
+ if (result != length) {
+ assert(0);
+ return NULL;
+ }
return buffer;
}
« no previous file with comments | « native_client_sdk/src/examples/api/input_event/shared_queue.h ('k') | native_client_sdk/src/examples/demo/voronoi/voronoi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698