Skip to content

Commit e468058

Browse files
committed
Increasing filename size to 1024 bytes.
To handle conda long build prefix.
1 parent b83af01 commit e468058

File tree

6 files changed

+10
-24
lines changed

6 files changed

+10
-24
lines changed

eoxmagmod/eoxmagmod/pyqd_eval_qdlatlon.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ static PyObject* eval_qdlatlon(PyObject *self, PyObject *args, PyObject *kwdict)
9292
goto exit;
9393

9494
// check the filename length
95-
if (strlen(model_fname) > get_max_fname_lenght()) {
95+
if (strlen(model_fname) > MAX_PATH_LENGTH) {
9696
PyErr_Format(
9797
PyExc_RuntimeError,
9898
"Filename is too long and exceeds the maximum allowed %d bytes! filename = %s",
99-
get_max_fname_lenght(), model_fname
99+
MAX_PATH_LENGTH, model_fname
100100
);
101101
goto exit;
102102
}

qdipole/apexsh.f90

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ module apxshmodule
149149
! Re = Mean radius of Earth in km
150150
! ecc2 = squared eccentricity of ellipsoidal Earth
151151

152-
character(256) :: datafile
152+
character(1024) :: datafile
153153
real(4) :: epoch
154154
real(4) :: altlastq, altlastg
155155
logical :: loadflag = .true.
@@ -164,7 +164,7 @@ subroutine loadapxsh(datafilenew,epochnew)
164164

165165
implicit none
166166

167-
character(256) :: datafilenew, datafilelast=''
167+
character(1024) :: datafilenew, datafilelast=''
168168
real(4) :: epochnew, epochlast=-999.0
169169
real(8) :: we0, we1
170170
integer(4) :: iepoch0, iepoch1, iterm, icoord

qdipole/cqdipole.c

-9
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
#include <string.h>
3737
#include "cqdipole.h"
3838

39-
#define MAX_PATH_LENGTH 256
40-
41-
4239
static int check_string_lenght(const char *srt, const size_t size)
4340
{
4441
return strlen(srt) > size;
@@ -53,12 +50,6 @@ static void copy_string(char *dst, const char *src, const size_t size)
5350
}
5451

5552

56-
size_t get_max_fname_lenght()
57-
{
58-
return MAX_PATH_LENGTH;
59-
}
60-
61-
6253
void eval_mlt_(double*, const double*, const double*, const int*);
6354

6455
int c_eval_mlt(double *t_mlt, const double *qdlon, const double *t_mjd2k,

qdipole/cqdipole.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@
3131
#ifndef CQDIPOLE_H
3232
#define CQDIPOLE_H
3333

34-
/**
35-
* @brief Get filename size limit.
36-
* @returns maximum length of the filename path
37-
*/
38-
39-
size_t get_max_fname_lenght();
34+
#define MAX_PATH_LENGTH 1024
4035

4136

4237
/**

qdipole/eval_qdlatlon.f90

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
! gclat vector of geocentric latitudes (degrees)
3030
! gdlon vector of geocentric longitudes (degrees)
3131
! n_data number of points, i.e., vector size
32-
! coeff_file path to the coefficients (string up to 256 characters)
32+
! coeff_file path to the coefficients (string up to 1024 characters)
3333
!
3434
! OUTPUT ARGUMENTS
3535
! qdlat array of Quasi-Dipole latitudes
@@ -50,7 +50,7 @@
5050
! gclat vector of geocentric latitudes (degrees)
5151
! gdlon vector of geocentric longitudes (degrees)
5252
! n_data number of points, i.e., vector size
53-
! coeff_file path to the coefficients (string up to 256 characters)
53+
! coeff_file path to the coefficients (string up to 1024 characters)
5454
!
5555
! OUTPUT ARGUMENTS
5656
! qdlat array of Quasi-Dipole latitudes
@@ -72,7 +72,7 @@ subroutine eval_qdlatlon(qdlat, qdlon, t_dy, gcrad, gclat, gclon,&
7272
real*4 gdalt, gdlat, gdlon, xqdlat, xqdlon, xf1(2), xf2(2), xf
7373
real*4 epoch, epoch_limit, epoch_old
7474
integer*4 vecflag, n_data, i
75-
character*256 coeff_file
75+
character*1024 coeff_file
7676
parameter(epoch_limit = 1./365.25, vecflag = 0)
7777

7878
epoch_old = -9999.9

qdipole/qdlatlon_test.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ int main(int argc, char* argv[])
6464
}
6565
printf("Using: %s\n", basename(fname));
6666

67-
if (strlen(fname) > get_max_fname_lenght())
67+
if (strlen(fname) > MAX_PATH_LENGTH)
6868
{
69-
fprintf(stderr, "ERROR: Filename is too long and exceeds the maximum allowed %d bytes! filename = %s\n", get_max_fname_lenght(), fname);
69+
fprintf(stderr, "ERROR: Filename is too long and exceeds the maximum allowed %d bytes! filename = %s\n", MAX_PATH_LENGTH, fname);
7070
return 1;
7171
}
7272

0 commit comments

Comments
 (0)