aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common.c3
-rw-r--r--src/net.c2
-rw-r--r--src/tar.c3
-rw-r--r--src/wine.c20
4 files changed, 7 insertions, 21 deletions
diff --git a/src/common.c b/src/common.c
index 29aa3db..151e3a7 100644
--- a/src/common.c
+++ b/src/common.c
@@ -80,7 +80,8 @@ int makeDir(const char* path)
return mkdir(path, 0755);
}
-int removeDir(const char *path) {
+int removeDir(const char *path)
+{
DIR *d = opendir(path);
size_t path_len = strlen(path);
int r = -1;
diff --git a/src/net.c b/src/net.c
index a90533b..b2851db 100644
--- a/src/net.c
+++ b/src/net.c
@@ -34,7 +34,7 @@ static int xferinfo(UNUSED void *p, curl_off_t dltotal, curl_off_t dlnow, UNUSED
{
curl_off_t progress = 0;
if (dltotal != 0)
- progress = ((float)dlnow / dltotal) * 100;
+ progress = (dlnow * 100) / dltotal;
fprintf(stderr, "\rProgress: %3" CURL_FORMAT_CURL_OFF_T "%%", progress);
diff --git a/src/tar.c b/src/tar.c
index 6e90aa5..cbaf875 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -22,7 +22,8 @@ static int copy_data(struct archive* ar, struct archive* aw)
if (r == ARCHIVE_EOF) return (ARCHIVE_OK);
if (r < ARCHIVE_OK) return (r);
- r = archive_write_data_block(aw, buff, size, offset);
+ // why does read return an int but write not?
+ r = (int)archive_write_data_block(aw, buff, size, offset);
if (r < ARCHIVE_OK)
{
diff --git a/src/wine.c b/src/wine.c
index d067ca6..1a21eb8 100644
--- a/src/wine.c
+++ b/src/wine.c
@@ -233,24 +233,8 @@ COMMAND(wine, run)
if (isFile(winepath))
{
- // quote the winepath so whitespace won't cause trouble
- {
- char winepathcpy[PATH_MAX] = {0};
- strncat(winepathcpy, "\"", sizeof(winepathcpy) - strlen(winepathcpy) - 1);
- strncat(winepathcpy, winepath, sizeof(winepathcpy) - strlen(winepathcpy) - 1);
- strncat(winepathcpy, "\"", sizeof(winepathcpy) - strlen(winepathcpy) - 1);
- strncpy(winepath, winepathcpy, sizeof(winepathcpy));
- }
-
- for (int i = 2; i < argc; ++i)
- {
- // make sure the passed arguments are in quotes so spaces don't cause problems
- strncat(winepath, " \"", sizeof(winepath) - strlen(winepath) - 1);
- strncat(winepath, argv[i], sizeof(winepath) - strlen(winepath) - 1);
- strncat(winepath, "\"", sizeof(winepath) - strlen(winepath) - 1);
- }
-
- return system(winepath);
+ argv[1] = winepath;
+ return execvp(winepath, argv+1);
}
else
{