summaryrefslogtreecommitdiff
blob: b39a6492251864cc44a0492e2c40281841211b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff -Naur bitlbee-0.91/bitlbee.c bitlbee-0.91-gentoohack/bitlbee.c
--- bitlbee-0.91/bitlbee.c	2004-11-21 15:52:28.000000000 +0100
+++ bitlbee-0.91-gentoohack/bitlbee.c	2004-12-21 17:15:15.000000000 +0100
@@ -285,6 +285,7 @@
 	account_t *a;
 	FILE *fp;
 	char *hash;
+	int retval;
 	
 	/*\
 	 *  [SH] Nothing should be saved if no password is set, because the
@@ -344,11 +345,16 @@
 	g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts~" );
 	fp = fopen( path, "w" );
 	if( !fp ) return( 0 );
-	if( fprintf( fp, "%s", hash ) != strlen( hash ) )
+	retval = fprintf( fp, "%s", hash );
+	if( retval != strlen( hash ) )
 	{
-		irc_usermsg( irc, "fprintf() wrote too little. Disk full?" );
-		fclose( fp );
-		return( 0 );
+		if( retval == 1) {
+			irc_usermsg( irc, "Enabling writing hack for gentoo. This is dangerous and may corrupt your files.");
+		} else {
+			irc_usermsg( irc, "fprintf() wrote too little. Disk full?" );
+			fclose( fp );
+			return( 0 );
+		}
 	}
 	g_free( hash );