Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 3be0cd8e authored by deuce's avatar deuce

More \r trimming from line endings.

parent c5508f70
......@@ -362,6 +362,10 @@ ODAPIDEF void ODCALL ODConfigInit(void)
ch = fgetc(pfCustomDropFile);
} while(ch != '\n' && ch != EOF);
}
if(szTempString[strlen(szTempString) - 1] == '\r')
{
szTempString[strlen(szTempString) - 1] = '\0';
}
strupr(pchConfigText);
......
......@@ -1062,6 +1062,11 @@ void ODStringToName(char *pszToConvert)
{
pszToConvert[strlen(pszToConvert) - 1] = '\0';
}
/* Trim any CR character that may be at the end of the string. */
if(pszToConvert[strlen(pszToConvert) - 1] == '\r')
{
pszToConvert[strlen(pszToConvert) - 1] = '\0';
}
/* Change the first character to lower case. */
*pszToConvert = toupper(*pszToConvert);
......
......@@ -645,6 +645,10 @@ read_dorinfox:
{
szIFTemp[strlen(szIFTemp) - 1] = '\0';
}
if(szIFTemp[strlen(szIFTemp) - 1] == '\r')
{
szIFTemp[strlen(szIFTemp) - 1] = '\0';
}
strncpy(od_control.system_name, szIFTemp, 39);
od_control.system_name[39] = '\0';
......@@ -898,6 +902,7 @@ read_dorinfox:
if(fgets(szIFTemp,255,pfDropFile)==NULL) goto DropFileFail;
szIFTemp[25]='\0';
if(szIFTemp[strlen(szIFTemp)-1]=='\n') szIFTemp[strlen(szIFTemp)-1]='\0';
if(szIFTemp[strlen(szIFTemp)-1]=='\r') szIFTemp[strlen(szIFTemp)-1]='\0';
strcpy(od_control.user_location,szIFTemp);
/* Read line 12. */
......@@ -916,6 +921,7 @@ read_dorinfox:
if(fgets(szIFTemp,255,pfDropFile)==NULL) goto DropFileFail;
szIFTemp[15]='\0';
if(szIFTemp[strlen(szIFTemp)-1]=='\n') szIFTemp[strlen(szIFTemp)-1]='\0';
if(szIFTemp[strlen(szIFTemp)-1]=='\r') szIFTemp[strlen(szIFTemp)-1]='\0';
strcpy(od_control.user_password,szIFTemp);
/* Read line 15. */
......@@ -1090,6 +1096,8 @@ again:
od_control.user_comment[79]='\0';
if(od_control.user_comment[strlen(od_control.user_comment)-1]=='\n')
od_control.user_comment[strlen(od_control.user_comment)-1]='\0';
if(od_control.user_comment[strlen(od_control.user_comment)-1]=='\r')
od_control.user_comment[strlen(od_control.user_comment)-1]='\0';
/* Read line 54. */
if(fgets((char *)apszDropFileInfo[20],80,pfDropFile)==NULL) goto finished;
......
......@@ -210,6 +210,10 @@ ODAPIDEF BOOL ODCALL od_list_files(char *pszFileSpec)
{
bUseNextLine = FALSE;
}
if(szLine[strlen(szLine) - 1] == '\r')
{
szLine[strlen(szLine) - 1] = '\0';
}
if(chLastControlKey != 0)
{
......
No preview for this file type
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