Verified Commit f077ebe7 authored by Camil Staps's avatar Camil Staps
Browse files

Warn when the linker command line exceeds 32767 characters on Windows; add...

Warn when the linker command line exceeds 32767 characters on Windows; add terminating NULL character
parent c6f1f03b
Pipeline #45956 passed with stage
in 14 seconds
......@@ -3856,12 +3856,18 @@ static int link_project (P_NODE first_project_node,char *options_file_name,char
*cmd++=*c;
*cmd++='"';
for (arg=argv+1; *arg; arg++){
if (cmd+3+strlen(arg) > &buffer[32766]){
fprintf (stderr,"Linker command line requires more than 32767 characters (use cpm instead)\n");
exit (1);
}
*cmd++=' ';
*cmd++='"';
for (char *c=*arg; *c; c++)
*cmd++=*c;
*cmd++='"';
}
*cmd='\0';
if (!CreateProcess (linker_file_name_,buffer,NULL,NULL,TRUE,0,NULL,NULL,&si,&pi)){
fprintf (stderr,"CreateProcess failed\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment