diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-08-07 23:01:33 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-08-07 23:01:33 +0000 | 
| commit | ee8648bdac07986a0f1ec897b02ec82a2f144d46 (patch) | |
| tree | 52d1861acda1205241ee35a94aa63129c604d469 /include/llvm/Support/raw_ostream.h | |
| parent | 1a82d4c088707c791c792f6822f611b47a12bdfe (diff) | |
Diffstat (limited to 'include/llvm/Support/raw_ostream.h')
| -rw-r--r-- | include/llvm/Support/raw_ostream.h | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index b59317112c44..28e512c86941 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -165,8 +165,10 @@ public:      if (Size > (size_t)(OutBufEnd - OutBufCur))        return write(Str.data(), Size); -    memcpy(OutBufCur, Str.data(), Size); -    OutBufCur += Size; +    if (Size) { +      memcpy(OutBufCur, Str.data(), Size); +      OutBufCur += Size; +    }      return *this;    } | 
