Index: otr.c
===================================================================
--- otr.c	(revision ddcff199f55d46ba67ade27e7a35b61f485c1fcd)
+++ otr.c	(revision c77406ae3fd357c3d2eabd36ec524e049e265857)
@@ -185,7 +185,4 @@
 /* find a private key by fingerprint prefix (given as any number of hex strings) */
 OtrlPrivKey *match_privkey(irc_t *irc, const char **args);
-
-/* check whether a string is safe to use in a path component */
-int strsane(const char *s);
 
 /* functions to be called for certain events */
@@ -278,15 +275,13 @@
 	int kg=0;
 
-	if(strsane(irc->user->nick)) {
-		g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, irc->user->nick);
-		e = otrl_privkey_read(irc->otr->us, s);
-		if(e && e!=enoent) {
-			irc_rootmsg(irc, "otr load: %s: %s", s, gcry_strerror(e));
-		}
-		g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, irc->user->nick);
-		e = otrl_privkey_read_fingerprints(irc->otr->us, s, NULL, NULL);
-		if(e && e!=enoent) {
-			irc_rootmsg(irc, "otr load: %s: %s", s, gcry_strerror(e));
-		}
+	g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, irc->user->nick);
+	e = otrl_privkey_read(irc->otr->us, s);
+	if(e && e!=enoent) {
+		irc_rootmsg(irc, "otr load: %s: %s", s, gcry_strerror(e));
+	}
+	g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, irc->user->nick);
+	e = otrl_privkey_read_fingerprints(irc->otr->us, s, NULL, NULL);
+	if(e && e!=enoent) {
+		irc_rootmsg(irc, "otr load: %s: %s", s, gcry_strerror(e));
 	}
 	
@@ -311,12 +306,10 @@
 	gcry_error_t e;
 
-	if(strsane(irc->user->nick)) {
-		g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, irc->user->nick);
-		e = otrl_privkey_write_fingerprints(irc->otr->us, s);
-		if(e) {
-			irc_rootmsg(irc, "otr save: %s: %s", s, gcry_strerror(e));
-		}
-		chmod(s, 0600);
-	}
+	g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, irc->user->nick);
+	e = otrl_privkey_write_fingerprints(irc->otr->us, s);
+	if(e) {
+		irc_rootmsg(irc, "otr save: %s: %s", s, gcry_strerror(e));
+	}
+	chmod(s, 0600);
 }
 
@@ -325,10 +318,8 @@
 	char s[512];
 	
-	if(strsane(nick)) {
-		g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, nick);
-		unlink(s);
-		g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, nick);
-		unlink(s);
-	}
+	g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, nick);
+	unlink(s);
+	g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, nick);
+	unlink(s);
 }
 
@@ -337,12 +328,10 @@
 	char s[512], t[512];
 	
-	if(strsane(nnick) && strsane(onick)) {
-		g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, onick);
-		g_snprintf(t, 511, "%s%s.otr_keys", global.conf->configdir, nnick);
-		rename(s,t);
-		g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, onick);
-		g_snprintf(t, 511, "%s%s.otr_fprints", global.conf->configdir, nnick);
-		rename(s,t);
-	}
+	g_snprintf(s, 511, "%s%s.otr_keys", global.conf->configdir, onick);
+	g_snprintf(t, 511, "%s%s.otr_keys", global.conf->configdir, nnick);
+	rename(s,t);
+	g_snprintf(s, 511, "%s%s.otr_fprints", global.conf->configdir, onick);
+	g_snprintf(t, 511, "%s%s.otr_fprints", global.conf->configdir, nnick);
+	rename(s,t);
 }
 
@@ -1788,17 +1777,12 @@
 	irc_rootmsg(irc, "%s", msg);
 	if(filename[0]) {
-		if(strsane(irc->user->nick)) {
-			char *kf = g_strdup_printf("%s%s.otr_keys", global.conf->configdir, irc->user->nick);
-			char *tmp = g_strdup_printf("%s.new", kf);
-			copyfile(filename, tmp);
-			unlink(filename);
-			rename(tmp,kf);
-			otrl_privkey_read(irc->otr->us, kf);
-			g_free(kf);
-			g_free(tmp);
-		} else {
-			otrl_privkey_read(irc->otr->us, filename);
-			unlink(filename);
-		}
+		char *kf = g_strdup_printf("%s%s.otr_keys", global.conf->configdir, irc->user->nick);
+		char *tmp = g_strdup_printf("%s.new", kf);
+		copyfile(filename, tmp);
+		unlink(filename);
+		rename(tmp,kf);
+		otrl_privkey_read(irc->otr->us, kf);
+		g_free(kf);
+		g_free(tmp);
 	}
 	
@@ -1875,9 +1859,3 @@
 }
 
-/* check whether a string is safe to use in a path component */
-int strsane(const char *s)
-{
-	return strpbrk(s, "/\\") == NULL;
-}
-
 /* vim: set noet ts=4 sw=4: */
