if ((i = readlink(target, tbuf, sizeof(tbuf)-1)) >= 0 && i == size && strncmp(buf, tbuf, (int) size) == 0) {
if ((i = readlink(target, tbuf, sizeof(tbuf)-1)) != -1) tbuf[i] = '\0'; if (i != -1 && i == size && strncmp(buf, tbuf, (size_t) size) == 0) {
static void recvlink(new, opts, mode, size)	char *new;	opt_t opts;	int mode;	off_t size;{	struct stat stb;	char *optarget;	off_t i;	/*	 * Read basic link info	 */	ack();	(void) remline(buf, sizeof(buf), TRUE);	if (response() < 0) {		err();		return;	}	/*	 * Make new symlink using a temporary name	 */	if (symlink(buf, new) < 0) {		if (errno != ENOENT || chkparent(new, opts) < 0 ||		    symlink(buf, new) < 0) {			error("%s -> %s: symlink failed: %s", new, buf,SYSERR);			(void) unlink(new);			return;		}	}	/*	 * Do comparison of what link is pointing to if enabled	 */	mode &= 0777;	if (IS_ON(opts, DO_COMPARE)) {		char tbuf[MAXPATHLEN];				if ((i = readlink(target, tbuf, sizeof(tbuf)-1)) >= 0 &&		    i == size && strncmp(buf, tbuf, (int) size) == 0) {			(void) unlink(new);			ack();			return;		}		if (IS_ON(opts, DO_VERIFY)) {			(void) unlink(new);			message(MT_REMOTE|MT_INFO, "%s: need to update",				target);			(void) sendcmd(C_END, NULL);			(void) response();			return;		}	}	/*	 * See if target is a directory and remove it if it is	 */	if (lstat(target, &stb) == 0) {		if (S_ISDIR(stb.st_mode)) {			optarget = ptarget;			for (ptarget = target; *ptarget; ptarget++);			if (removefile(&stb) < 0) {				ptarget = optarget;				(void) unlink(new);				(void) sendcmd(C_END, NULL);				(void) response();				return;			}			ptarget = optarget;		}	}	/*	 * Install link as the target	 */	if (rename(new, target) < 0) {		error("%s -> %s: symlink rename failed: %s",		      new, target, SYSERR);		(void) unlink(new);		(void) sendcmd(C_END, NULL);		(void) response();		return;	}	if (IS_ON(opts, DO_COMPARE))		message(MT_REMOTE|MT_CHANGE, "%s: updated", target);	else	        ack();	/*	 * Indicate end of receive operation	 */	(void) sendcmd(C_END, NULL);	(void) response();}