soloscli: fix new lines in soloscli
If the string received from the ADSL firmware is missing \n, add it in. Signed-off-by: Nathan Williams <nathan@traverse.com.au> SVN-Revision: 27096
This commit is contained in:
		| @@ -1,5 +1,5 @@ | |||||||
| # | # | ||||||
| # Copyright (C) 2006-2010 OpenWrt.org | # Copyright (C) 2006-2011 OpenWrt.org | ||||||
| # | # | ||||||
| # This is free software, licensed under the GNU General Public License v2. | # This is free software, licensed under the GNU General Public License v2. | ||||||
| # See /LICENSE for more information. | # See /LICENSE for more information. | ||||||
| @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |||||||
|  |  | ||||||
| PKG_NAME:=soloscli | PKG_NAME:=soloscli | ||||||
| PKG_VERSION:=0.11 | PKG_VERSION:=0.11 | ||||||
| PKG_RELEASE:=1 | PKG_RELEASE:=2 | ||||||
|  |  | ||||||
| PKG_SOURCE:=solos-pci-$(PKG_VERSION).tar.gz | PKG_SOURCE:=solos-pci-$(PKG_VERSION).tar.gz | ||||||
| PKG_SOURCE_URL:=@SF/openadsl | PKG_SOURCE_URL:=@SF/openadsl | ||||||
|   | |||||||
| @@ -1,11 +1,15 @@ | |||||||
| --- a/soloscli/soloscli.c | --- a/soloscli/soloscli.c | ||||||
| +++ b/soloscli/soloscli.c | +++ b/soloscli/soloscli.c | ||||||
| @@ -238,7 +238,7 @@ | @@ -238,7 +238,11 @@ | ||||||
|  	} |  	} | ||||||
|  	if (strcmp(buf,pid) == 0) { |  	if (strcmp(buf,pid) == 0) { | ||||||
|  /*		printf("Sequence matches.\n"); */ |  /*		printf("Sequence matches.\n"); */ | ||||||
| -		printf("%s",bufp); | -		printf("%s",bufp); | ||||||
|  | +		if(buf[(len-1)] == '\n'){ | ||||||
|  | +			printf("%s",bufp); | ||||||
|  | +		} else { | ||||||
| +			printf("%s\n",bufp); | +			printf("%s\n",bufp); | ||||||
|  | +		} | ||||||
|  	} else { |  	} else { | ||||||
|  		printf("Sequence incorrect.\n"); |  		printf("Sequence incorrect.\n"); | ||||||
|  		buf[i] = '\n'; |  		buf[i] = '\n'; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Florian Fainelli
					Florian Fainelli