Skip to content
Snippets Groups Projects
Commit 0983315c authored by David Anderson's avatar David Anderson
Browse files

use MAXPATHLEN and sizeof() a few places; from Gianfranco

parent 023e1ce6
Branches
Tags
No related merge requests found
......@@ -179,7 +179,7 @@ void CLIENT_STATE::detect_platforms() {
for (i=0; i < nlibdirs; i++) {
struct dirent *entry;
DIR *a = opendir(libdir[i]);
// if dir doesn't exist, do to the next one
// if dir doesn't exist, do the next one
if (a == 0) continue;
// dir exists. read each entry until you find a 32bit lib
while ((support32 == 0) && ((entry=readdir(a)) != 0)) {
......
......@@ -69,7 +69,7 @@ int make_soft_link(PROJECT* project, char* link_path, char* rel_file_path) {
//
void get_pathname(FILE_INFO* fip, char* path, int len) {
PROJECT* p = fip->project;
char buf[1024];
char buf[MAXPATHLEN];
// for testing purposes, it's handy to allow a FILE_INFO without
// an associated PROJECT.
......@@ -176,7 +176,7 @@ int remove_project_dir(PROJECT& p) {
// Create the slot directory for the specified slot #
//
int make_slot_dir(int slot) {
char buf[1024];
char buf[MAXPATHLEN];
if (slot<0) {
msg_printf(NULL, MSG_INTERNAL_ERROR, "Bad slot number %d", slot);
......
......@@ -74,14 +74,14 @@ static _CrtMemState difference_snapshot;
static int diagnostics_initialized = false;
static int flags;
static char stdout_log[256];
static char stdout_archive[256];
static char stdout_log[MAXPATHLEN];
static char stdout_archive[MAXPATHLEN];
static FILE* stdout_file;
static char stderr_log[256];
static char stderr_archive[256];
static char stderr_log[MAXPATHLEN];
static char stderr_archive[MAXPATHLEN];
static FILE* stderr_file;
static char boinc_dir[256];
static char boinc_install_dir[256];
static char boinc_dir[MAXPATHLEN];
static char boinc_install_dir[MAXPATHLEN];
static int boinc_proxy_enabled;
static char boinc_proxy[256];
static char symstore[256];
......@@ -330,13 +330,13 @@ int diagnostics_init(
mf.init_file(p);
while(mf.fgets(buf, sizeof(buf))) {
if (match_tag(buf, "</app_init_data>")) break;
else if (parse_str(buf, "<boinc_dir>", boinc_dir, 256)) continue;
else if (parse_str(buf, "<symstore>", symstore, 256)) continue;
else if (parse_str(buf, "<boinc_dir>", boinc_dir, sizeof(boinc_dir))) continue;
else if (parse_str(buf, "<symstore>", symstore, sizeof(symstore))) ;
else if (match_tag(buf, "<use_http_proxy/>")) {
boinc_proxy_enabled = true;
continue;
}
else if (parse_str(buf, "<http_server_name>", proxy_address, 256)) continue;
else if (parse_str(buf, "<http_server_name>", proxy_address, sizeof(proxy_address))) continue;
else if (parse_int(buf, "<http_server_port>", proxy_port)) continue;
}
fclose(p);
......
......@@ -107,7 +107,7 @@ bool is_localhost(sockaddr_storage& s) {
case AF_INET6: {
sockaddr_in6* sin = (sockaddr_in6*)&s;
char buf[256];
inet_ntop(AF_INET6, (void*)(&sin->sin6_addr), buf, 256);
inet_ntop(AF_INET6, (void*)(&sin->sin6_addr), buf, sizeof(buf));
return (strcmp(buf, "::1") == 0);
break;
}
......
......@@ -49,6 +49,7 @@
#include "str_util.h"
#include "str_replace.h"
#include "filesys.h"
#include "procinfo.h"
......
#! /usr/bin/env perl
use Time::Local;
# What version is this?
$majorversion = 2; $minorversion = 1;
# Directory where gnuplot is
# $gnuplot = "/usr/local/gnuplot-3.7";
#$gnuplot = "/disks/asimov/a/users/hiramc/local/src/gnuplot-3.7";
$gnuplot = "/usr/local/bin"
# Temporary files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment