@@ -2208,7 +2208,7 @@ static void abc_substitute(ABCHANDLE *h, char *target, char *s)
22082208 int n = strlen (s);
22092209 if (l <= 0 ||n <= 0 || strstr (s, target) || abs (n-l) > 10e3 )
22102210 return ;
2211- while ( ( p=strstr (h->line , target)) ) {
2211+ while (( p=strstr (h->line , target)) != NULL ) {
22122212 if ( (i=strlen (h->line )) + n - l >= (int )h->len ) {
22132213 int reqsize = h->len <<1 ;
22142214 while (i + n - l >= reqsize) reqsize = reqsize<<1 ;
@@ -3684,7 +3684,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
36843684 abcstate = INSKIPFORX;
36853685 abcxcount = 0 ;
36863686 mmfseek (mmfile,0 ,SEEK_SET);
3687- while ( ( line=abc_gets (h, mmfile)) ) {
3687+ while (( line=abc_gets (h, mmfile)) != NULL ) {
36883688 for ( p=line; isspace (*p); p++ ) ;
36893689 if ( !strncmp (p," X:" ,2 ) ) abcxcount++;
36903690 }
@@ -3697,7 +3697,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
36973697 }
36983698 while ( mmsp > 0 ) {
36993699 mmsp--;
3700- while ((line=abc_gets (h, mmstack[mmsp]))) {
3700+ while ((line=abc_gets (h, mmstack[mmsp])) != NULL ) {
37013701 char blankline[3 ] = " % " ;
37023702 for ( p=line; isspace (*p); p++ ) ;
37033703 switch (abcstate) {
@@ -4072,7 +4072,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
40724072 // plough thru the songline gathering mos....
40734073 ch0 = ' ' ;
40744074 pp = 0 ;
4075- while ( *p && (ch = *p++) ) {
4075+ while ( *p && (ch = *p++) != ' \0 ' ) {
40764076 if ( !pp && isalpha (ch) && *p != ' :' ) { // maybe a macro
40774077 for ( mp=h->umacro ; mp; mp=mp->next ) {
40784078 if ( ch == mp->name [0 ] ) {
@@ -4178,7 +4178,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
41784178 h->tp = abc_check_track (h, h->tp );
41794179 abc_track_clear_tiedvpos (h);
41804180 abcbeatvol = abc_beat_vol (h, abcvol, (h->tracktime - bartime)/barticks);
4181- while ( *p && (ch=*p++) && (ch != ' ]' ) ) {
4181+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' ]' )) {
41824182 h->tp = abc_locate_track (h, h->tp ->v , abcchord? abcchord+DRONEPOS2: 0 );
41834183 p += abc_add_noteon (h, ch, p, h->tracktime , barsig, abcbeatvol, abceffect, abceffoper);
41844184 p += abc_notelen (p, ¬elen, ¬ediv);
@@ -4346,7 +4346,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
43464346 int barticks = notelen_notediv_to_ticks (h->speed ,1 ,mnotediv);
43474347 if (barticks == 0 ) barticks = 1 ;
43484348 abcbeatvol = abc_beat_vol (h, abcvol, (h->tracktime - bartime)/barticks);
4349- while ( *p && (ch=*p++) && (ch != ' }' ) ) {
4349+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' }' )) {
43504350 p += abc_add_noteon (h, ch, p, h->tracktime +abcgrace, barsig, abcbeatvol, none, 0 );
43514351 p += abc_notelen (p, ¬elen, ¬ediv);
43524352 if ( *p==' -' ) {
@@ -4432,7 +4432,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
44324432 if ( h->tp == h->tpc ) abc_add_chord (p, h, h->tpc , h->tracktime ); // only do chords for one voice
44334433 }
44344434 abcto = 0 ;
4435- while ( *p && (ch=*p++) && (ch != ' "' ) ) {
4435+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' "' )) {
44364436 if ( !strncasecmp (p," fade" ,4 ) && h->track && h->track ->slidevol > -2 )
44374437 abc_globalslide (h, h->tracktime , -2 ); // set volumeslide to fade away...
44384438 if ( !strncasecmp (p," to coda" ,7 ) ) {
@@ -4641,7 +4641,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
46414641 else {
46424642 h->tp = abc_check_track (h, h->tp );
46434643 abcvol = abc_parse_decorations (h, h->tp , p);
4644- while ( *p && (ch=*p++) && (ch != ' +' ) )
4644+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' +' ))
46454645 ;
46464646 }
46474647 break ;
@@ -4818,7 +4818,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
48184818 pat = (tracktick div speed) div 64
48194819 ord = calculated
48204820*/
4821- if ( ( p=getenv (ABC_ENV_DUMPTRACKS)) ) {
4821+ if (( p=getenv (ABC_ENV_DUMPTRACKS)) != NULL ) {
48224822 printf (" P:%s\n " ,abcparts);
48234823 for ( t=0 ; t<26 ; t++ )
48244824 if ( partpat[t][1 ] >= partpat[t][0 ] )
0 commit comments