int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
xdemitcb_t *ecb) {
+ int i = 2;
mmbuffer_t mb[3];
- int i;
mb[0].ptr = (char *) pre;
mb[0].size = psize;
mb[1].ptr = (char *) rec;
mb[1].size = size;
- i = 2;
-
- if (!size || rec[size-1] != '\n') {
- mb[2].ptr = "\n\\ No newline at end of file\n";
+ if (size > 0 && rec[size - 1] != '\n') {
+ mb[2].ptr = (char *) "\n\\ No newline at end of file\n";
mb[2].size = strlen(mb[2].ptr);
- i = 3;
+ i++;
}
-
if (ecb->outf(ecb->priv, mb, i) < 0) {
return -1;
#define XUTILS_H
+
long xdl_bogosqrt(long n);
int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
xdemitcb_t *ecb);