3a2d225682
fprintf returns a negative value in order to signal an error. We have to detect this situation in epicsStrPrintEscaped and return a negative when fprintf returns a negative value in order to give the calling code a chance to detect this situation. The old implementation (of simply accumulating the return values of fprintf) was wrong anyway, because it would not only lead to an error in fprintf to be lost but would also cause the returned number to be too small (not representing the actual number of bytes written) in such a case. The only case where the old implementation would work correctly was when all calls to fprintf succeeded or all these calls failed.