Skip to content

Commit

Permalink
Replace presumably accidental bitwise AND operations
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Feb 12, 2024
1 parent b168865 commit f5852a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6614,7 +6614,7 @@ void setBidsSiemens(struct TDICOMdata *d, int nConvert, int isVerbose, const cha
for (int i = 0; i < len; i++) {
char ch = seqName[i];
if (ch == '*') continue;
if ((ch >= '0' & ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
strncat(acqStr, &ch, 1);
if (isdigit(ch)) break;
}
Expand Down Expand Up @@ -6805,23 +6805,23 @@ void setBidsPhilips(struct TDICOMdata *d, int nConvert, int isVerbose) {
if (len > 0) {
for (int i = 0; i < len; i++) {
char ch = seqName[i];
if ((ch >= '0' & ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
strncat(acqStr, &ch, 1);
}
} //len > 0
len = strlen(d->scanningSequence);
if (len > 0) {
for (int i = 0; i < len; i++) {
char ch = d->scanningSequence[i];
if ((ch >= '0' & ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
strncat(acqStr, &ch, 1);
}
} //len > 0
len = strlen(d->pulseSequenceName);
if (len > 0) {
for (int i = 0; i < len; i++) {
char ch = d->pulseSequenceName[i];
if ((ch >= '0' & ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
strncat(acqStr, &ch, 1);
}
} //len > 0
Expand Down Expand Up @@ -6981,7 +6981,7 @@ void setBidsGE(struct TDICOMdata *d, int nConvert, int isVerbose, const char *fi
if (len > 0) {
for (int i = 0; i < len; i++) {
char ch = seqName[i];
if ((ch >= '0' & ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
strncat(acqStr, &ch, 1);
//if (isdigit(ch)) break; // do not use, unlike Siemens digit can come at start 3DFSE or end EFGRE3D
}
Expand Down

0 comments on commit f5852a1

Please sign in to comment.