Fix remaining issues with nxstyle

This commit is contained in:
Alan C. Assis 2020-04-16 23:02:46 -03:00 committed by patacongo
parent 04856ccfde
commit 6e403fc343
3 changed files with 34 additions and 28 deletions

View File

@ -41,17 +41,17 @@
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS''
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* SUCH DAMAGE. * THE POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/

View File

@ -40,17 +40,17 @@
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS''
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* SUCH DAMAGE. * THE POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/

View File

@ -249,8 +249,9 @@ static int calc_codec_buffsize(int srclen, uint8_t mode)
****************************************************************************/ ****************************************************************************/
#ifdef NEED_CMD_CODECS_PROC #ifdef NEED_CMD_CODECS_PROC
static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv, static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc,
uint8_t mode, codec_callback_t func) char **argv, uint8_t mode,
codec_callback_t func)
{ {
#ifdef HAVE_CODECS_HASH_MD5 #ifdef HAVE_CODECS_HASH_MD5
static const unsigned char hexchars[] = "0123456789abcdef"; static const unsigned char hexchars[] = "0123456789abcdef";
@ -289,7 +290,8 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
case 'w': case 'w':
iswebsafe = true; iswebsafe = true;
if (!(mode == CODEC_MODE_BASE64ENC || mode == CODEC_MODE_BASE64DEC)) if (!(mode == CODEC_MODE_BASE64ENC ||
mode == CODEC_MODE_BASE64DEC))
{ {
badarg = true; badarg = true;
} }
@ -308,7 +310,9 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv,
} }
} }
/* If a bad argument was encountered, then return without processing the command */ /* If a bad argument was encountered, then return without processing
* the command
*/
if (badarg) if (badarg)
{ {
@ -540,7 +544,8 @@ errout:
#ifdef HAVE_CODECS_URLENCODE #ifdef HAVE_CODECS_URLENCODE
int cmd_urlencode(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) int cmd_urlencode(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{ {
return cmd_codecs_proc(vtbl, argc, argv, CODEC_MODE_URLENCODE, urlencode_cb); return cmd_codecs_proc(vtbl, argc, argv, CODEC_MODE_URLENCODE,
urlencode_cb);
} }
#endif #endif
@ -551,7 +556,8 @@ int cmd_urlencode(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#ifdef HAVE_CODECS_URLDECODE #ifdef HAVE_CODECS_URLDECODE
int cmd_urldecode(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) int cmd_urldecode(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{ {
return cmd_codecs_proc(vtbl, argc, argv, CODEC_MODE_URLDECODE, urldecode_cb); return cmd_codecs_proc(vtbl, argc, argv, CODEC_MODE_URLDECODE,
urldecode_cb);
} }
#endif #endif