--- sourceforge.net/trunk/rdesktop/disk.c 2005/08/15 11:44:35 978 +++ sourceforge.net/trunk/rdesktop/disk.c 2005/09/22 00:16:31 1016 @@ -201,7 +201,7 @@ { int ret; off_t pos; - static const char zero; + static const char zero = 0; /* Try the simple method first */ if ((ret = ftruncate(fd, length)) != -1) @@ -209,7 +209,7 @@ return ret; } - /* + /* * Some kind of error. Perhaps we were trying to grow. Retry * in a safe way. */ @@ -325,7 +325,7 @@ fprintf(stderr, "share name %s truncated to %s\n", optarg, g_rdpdr_device[*id].name); - g_rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1); + g_rdpdr_device[*id].local_path = (char *) xmalloc(strlen(pos2) + 1); strcpy(g_rdpdr_device[*id].local_path, pos2); g_rdpdr_device[*id].device_type = DEVICE_TYPE_DISK; count++; @@ -491,7 +491,7 @@ g_fileinfo[handle].device_id = device_id; g_fileinfo[handle].flags_and_attributes = flags_and_attributes; g_fileinfo[handle].accessmask = accessmask; - strncpy(g_fileinfo[handle].path, path, PATH_MAX-1); + strncpy(g_fileinfo[handle].path, path, PATH_MAX - 1); g_fileinfo[handle].delete_on_close = False; g_notify_stamp = True; @@ -960,7 +960,7 @@ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; p->num_entries++; - fullname = xmalloc(strlen(pfinfo->path) + strlen(dp->d_name) + 2); + fullname = (char *) xmalloc(strlen(pfinfo->path) + strlen(dp->d_name) + 2); sprintf(fullname, "%s/%s", pfinfo->path, dp->d_name); if (!stat(fullname, &buf)) @@ -997,7 +997,7 @@ while ((e = getmntent(fdfs))) { - if (strncmp(fpath, e->mnt_dir, strlen(fpath)) == 0) + if (str_startswith(e->mnt_dir, fpath)) { strcpy(info.type, e->mnt_type); strcpy(info.name, e->mnt_fsname); @@ -1130,7 +1130,7 @@ /* If a search pattern is received, remember this pattern, and restart search */ if (pattern[0] != 0) { - strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX-1); + strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX - 1); rewinddir(pdir); }