@@ -2205,7 +2205,7 @@ static void abc_substitute(ABCHANDLE *h, char *target, char *s)
22052205 int n = strlen (s);
22062206 if (l <= 0 ||n <= 0 || strstr (s, target) || abs (n-l) > 10e3 )
22072207 return ;
2208- while ( ( p=strstr (h->line , target)) ) {
2208+ while (( p=strstr (h->line , target)) != NULL ) {
22092209 if ( (i=strlen (h->line )) + n - l >= (int )h->len ) {
22102210 int reqsize = h->len <<1 ;
22112211 while (i + n - l >= reqsize) reqsize = reqsize<<1 ;
@@ -3681,7 +3681,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
36813681 abcstate = INSKIPFORX;
36823682 abcxcount = 0 ;
36833683 mmfseek (mmfile,0 ,SEEK_SET);
3684- while ( ( line=abc_gets (h, mmfile)) ) {
3684+ while (( line=abc_gets (h, mmfile)) != NULL ) {
36853685 for ( p=line; isspace (*p); p++ ) ;
36863686 if ( !strncmp (p," X:" ,2 ) ) abcxcount++;
36873687 }
@@ -3694,7 +3694,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
36943694 }
36953695 while ( mmsp > 0 ) {
36963696 mmsp--;
3697- while ((line=abc_gets (h, mmstack[mmsp]))) {
3697+ while ((line=abc_gets (h, mmstack[mmsp])) != NULL ) {
36983698 char blankline[3 ] = " % " ;
36993699 for ( p=line; isspace (*p); p++ ) ;
37003700 switch (abcstate) {
@@ -4069,7 +4069,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
40694069 // plough thru the songline gathering mos....
40704070 ch0 = ' ' ;
40714071 pp = 0 ;
4072- while ( *p && (ch = *p++) ) {
4072+ while ( *p && (ch = *p++) != ' \0 ' ) {
40734073 if ( !pp && isalpha (ch) && *p != ' :' ) { // maybe a macro
40744074 for ( mp=h->umacro ; mp; mp=mp->next ) {
40754075 if ( ch == mp->name [0 ] ) {
@@ -4175,7 +4175,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
41754175 h->tp = abc_check_track (h, h->tp );
41764176 abc_track_clear_tiedvpos (h);
41774177 abcbeatvol = abc_beat_vol (h, abcvol, (h->tracktime - bartime)/barticks);
4178- while ( *p && (ch=*p++) && (ch != ' ]' ) ) {
4178+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' ]' )) {
41794179 h->tp = abc_locate_track (h, h->tp ->v , abcchord? abcchord+DRONEPOS2: 0 );
41804180 p += abc_add_noteon (h, ch, p, h->tracktime , barsig, abcbeatvol, abceffect, abceffoper);
41814181 p += abc_notelen (p, ¬elen, ¬ediv);
@@ -4343,7 +4343,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
43434343 int barticks = notelen_notediv_to_ticks (h->speed ,1 ,mnotediv);
43444344 if (barticks == 0 ) barticks = 1 ;
43454345 abcbeatvol = abc_beat_vol (h, abcvol, (h->tracktime - bartime)/barticks);
4346- while ( *p && (ch=*p++) && (ch != ' }' ) ) {
4346+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' }' )) {
43474347 p += abc_add_noteon (h, ch, p, h->tracktime +abcgrace, barsig, abcbeatvol, none, 0 );
43484348 p += abc_notelen (p, ¬elen, ¬ediv);
43494349 if ( *p==' -' ) {
@@ -4429,7 +4429,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
44294429 if ( h->tp == h->tpc ) abc_add_chord (p, h, h->tpc , h->tracktime ); // only do chords for one voice
44304430 }
44314431 abcto = 0 ;
4432- while ( *p && (ch=*p++) && (ch != ' "' ) ) {
4432+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' "' )) {
44334433 if ( !strncasecmp (p," fade" ,4 ) && h->track && h->track ->slidevol > -2 )
44344434 abc_globalslide (h, h->tracktime , -2 ); // set volumeslide to fade away...
44354435 if ( !strncasecmp (p," to coda" ,7 ) ) {
@@ -4638,7 +4638,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
46384638 else {
46394639 h->tp = abc_check_track (h, h->tp );
46404640 abcvol = abc_parse_decorations (h, h->tp , p);
4641- while ( *p && (ch=*p++) && (ch != ' +' ) )
4641+ while ( *p && (ch=*p++) != ' \0 ' && (ch != ' +' ))
46424642 ;
46434643 }
46444644 break ;
@@ -4815,7 +4815,7 @@ BOOL CSoundFile::ReadABC(const uint8_t *lpStream, DWORD dwMemLength)
48154815 pat = (tracktick div speed) div 64
48164816 ord = calculated
48174817*/
4818- if ( ( p=getenv (ABC_ENV_DUMPTRACKS)) ) {
4818+ if (( p=getenv (ABC_ENV_DUMPTRACKS)) != NULL ) {
48194819 printf (" P:%s\n " ,abcparts);
48204820 for ( t=0 ; t<26 ; t++ )
48214821 if ( partpat[t][1 ] >= partpat[t][0 ] )
0 commit comments