mirror of https://github.com/BOINC/boinc.git
Remark about strong exception safety of strcatdup
This is as good as it gets.
This commit is contained in:
parent
4aa4a67450
commit
e2c7b61d33
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue