浏览代码

fix printf length arguments on lp64

found by coverity.
Oswald Buddenhagen 5 年之前
父节点
当前提交
aff0c88a38
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/compat/config.c
  2. 1 1
      src/compat/main.c

+ 1 - 1
src/compat/config.c

@@ -259,7 +259,7 @@ write_imap_server( FILE *fp, config_t *cfg )
 			if (!p)
 				hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host );
 			else {
-				hl = nfsnprintf( buf, sizeof(buf), "%.*s", p - cfg->host, cfg->host );
+				hl = nfsnprintf( buf, sizeof(buf), "%.*s", (int)(p - cfg->host), cfg->host );
 				p2 = strrchr( buf, '.' );
 				if (p2)
 					hl = sprintf( buf, "%s", p2 + 1 );

+ 1 - 1
src/compat/main.c

@@ -376,7 +376,7 @@ main( int argc, char **argv )
 			if (!p)
 				nfsnprintf( path2, sizeof(path2), "%s.mbsync", config );
 			else
-				nfsnprintf( path2, sizeof(path2), "%.*smb%s", p - config, config, p + 1 );
+				nfsnprintf( path2, sizeof(path2), "%.*smb%s", (int)(p - config), config, p + 1 );
 			outconfig = path2;
 		}
 		if ((fd = creat( outconfig, 0666 )) < 0) {