From e2c7b61d33f75df0d106a4937ffba0006961580d Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Tue, 26 Apr 2016 22:38:11 +0200 Subject: [PATCH] Remark about strong exception safety of strcatdup This is as good as it gets. --- lib/parse.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/parse.cpp b/lib/parse.cpp index fd21a0205f..53ff8b0a2c 100644 --- a/lib/parse.cpp +++ b/lib/parse.cpp @@ -152,6 +152,8 @@ int copy_stream(FILE* in, FILE* out) { } // append to a malloc'd string +// If reallocation fails, the pointer p remains unchanged, and the data will +// not be freed. (strong exception safety) // int strcatdup(char*& p, char* buf) { char* new_p = (char*)realloc(p, strlen(p) + strlen(buf)+1);