]> sigrok.org Git - libsigrok.git/commit
hameg-hmo: Fix two compiler warnings (-Wstringop-truncation).
authorUwe Hermann <redacted>
Tue, 30 Jul 2019 18:33:20 +0000 (20:33 +0200)
committerUwe Hermann <redacted>
Tue, 30 Jul 2019 21:53:42 +0000 (23:53 +0200)
commit1838d9f13fe8b253895f8a19a0c53c9e3056cf65
treebcc62f3e7e6ee9ba3ea1092673cad74bb91f5b41
parentc38d69adf4f0038871a65eac44bb9ffd84a9786f
hameg-hmo: Fix two compiler warnings (-Wstringop-truncation).

  src/hardware/hameg-hmo/protocol.c: In function ‘hmo_scope_state_get’:
  src/hardware/hameg-hmo/protocol.c:1130:2: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation]
    strncpy(state->trigger_pattern,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     sr_scpi_unquote_string(tmp_str),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CC       src/hardware/hp-3478a/api.lo
    CC       src/hardware/hung-chang-dso-2100/protocol.lo
  src/hardware/hameg-hmo/api.c: In function ‘config_set’:
  src/hardware/hameg-hmo/api.c:388:3: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation]
     strncpy(state->trigger_pattern,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      tmp_str,
      ~~~~~~~~
      MAX_ANALOG_CHANNEL_COUNT + MAX_DIGITAL_CHANNEL_COUNT);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/hardware/hameg-hmo/protocol.h