X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FSafeAssert.cpp;h=62f3bc447d89724a1975afea30012002a3c583f1;hb=2ca10eeefdc1231a20fb1cb75dc3e8d2c5fa70ba;hp=ccb1cb4d0ce5121a972c5913203e6230c4731453;hpb=275ca94d04e44f28cfa411668eb1c1dd8db90b80;p=folly.git diff --git a/folly/SafeAssert.cpp b/folly/SafeAssert.cpp index ccb1cb4d..62f3bc44 100644 --- a/folly/SafeAssert.cpp +++ b/folly/SafeAssert.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,15 +22,18 @@ namespace folly { namespace detail { namespace { +void writeStderr(const char* s, size_t len) { + writeFull(STDERR_FILENO, s, len); +} void writeStderr(const char* s) { - writeFull(STDERR_FILENO, s, strlen(s)); + writeStderr(s, strlen(s)); } -} // namespace +} // namespace void assertionFailure(const char* expr, const char* msg, const char* file, unsigned int line, const char* function) { writeStderr("\n\nAssertion failure: "); - writeStderr(expr); + writeStderr(expr + 1, strlen(expr) - 2); writeStderr("\nMessage: "); writeStderr(msg); writeStderr("\nFile: "); @@ -46,4 +49,5 @@ void assertionFailure(const char* expr, const char* msg, const char* file, abort(); } -}} // namespaces +} // namespace detail +} // namespace folly