Merge pull request #192 from YashasSamaga/i187-fix

remove extra new lines from #warning and #pragma deprecated
This commit is contained in:
Zeex 2017-10-07 23:04:40 +06:00 committed by GitHub
commit a0c994493d

View File

@ -1122,8 +1122,10 @@ static int command(void)
while (*lptr<=' ' && *lptr!='\0')
lptr++;
pc_deprecate=(char*)malloc(strlen((char*)lptr)+1);
if (pc_deprecate!=NULL)
strcpy(pc_deprecate,(char*)lptr);
if (pc_deprecate!=NULL) {
strcpy(pc_deprecate,lptr);
pc_deprecate[strcspn(pc_deprecate,"\r\n")]='\0';
} /* if */
lptr=(unsigned char*)strchr((char*)lptr,'\0'); /* skip to end (ignore "extra characters on line") */
} else if (strcmp(str,"dynamic")==0) {
preproc_expr(&pc_stksize,NULL);
@ -1491,8 +1493,17 @@ static int command(void)
case tpWARNING:
while (*lptr<=' ' && *lptr!='\0')
lptr++;
if (!SKIPPING)
error(237,lptr); /* user warning */
if (!SKIPPING) {
char *usermsg=(char*)malloc(strlen(lptr)+1);
if(usermsg!=NULL) {
strcpy(usermsg,lptr);
usermsg[strcspn(usermsg,"\r\n")]='\0';
error(237,usermsg); /* user warning */
free(usermsg);
} else {
error(237,lptr);
} /* if */
} /* if */
break;
default:
error(31); /* unknown compiler directive */