Commit 497120bd authored by claes's avatar claes

strcpy replaced by strncpy

parent 77dc9829
/* /*
* Proview $Id: xtt_evlist.cpp,v 1.16 2007-01-30 06:54:59 claes Exp $ * Proview $Id: xtt_evlist.cpp,v 1.17 2007-10-24 14:00:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1507,8 +1507,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info) ...@@ -1507,8 +1507,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info)
case mh_eEventPrio_A: case mh_eEventPrio_A:
if ( a_cnt >= ALARM_INFO_A_SIZE) if ( a_cnt >= ALARM_INFO_A_SIZE)
break; break;
strcpy( info->a_alarm_text[a_cnt], object_item->eventtext); strncpy( info->a_alarm_text[a_cnt], object_item->eventtext,
strcpy( info->a_alarm_alias[a_cnt], object_item->alias); sizeof(info->a_alarm_text[0]));
strncpy( info->a_alarm_alias[a_cnt], object_item->alias,
sizeof(info->a_alarm_alias[0]));
info->a_alarm_active[a_cnt] = object_item->status & mh_mEventStatus_NotRet; info->a_alarm_active[a_cnt] = object_item->status & mh_mEventStatus_NotRet;
info->a_alarm_exist[a_cnt] = 1; info->a_alarm_exist[a_cnt] = 1;
a_cnt++; a_cnt++;
...@@ -1516,8 +1518,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info) ...@@ -1516,8 +1518,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info)
case mh_eEventPrio_B: case mh_eEventPrio_B:
if ( b_cnt >= ALARM_INFO_B_SIZE) if ( b_cnt >= ALARM_INFO_B_SIZE)
break; break;
strcpy( info->b_alarm_text[b_cnt], object_item->eventtext); strncpy( info->b_alarm_text[b_cnt], object_item->eventtext,
strcpy( info->b_alarm_alias[b_cnt], object_item->alias); sizeof(info->b_alarm_text[0]));
strncpy( info->b_alarm_alias[b_cnt], object_item->alias,
sizeof(info->b_alarm_alias[0]));
info->b_alarm_active[b_cnt] = object_item->status & mh_mEventStatus_NotRet; info->b_alarm_active[b_cnt] = object_item->status & mh_mEventStatus_NotRet;
info->b_alarm_exist[b_cnt] = 1; info->b_alarm_exist[b_cnt] = 1;
b_cnt++; b_cnt++;
...@@ -1525,8 +1529,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info) ...@@ -1525,8 +1529,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info)
case mh_eEventPrio_C: case mh_eEventPrio_C:
if ( c_cnt >= ALARM_INFO_C_SIZE) if ( c_cnt >= ALARM_INFO_C_SIZE)
break; break;
strcpy( info->c_alarm_text[c_cnt], object_item->eventtext); strncpy( info->c_alarm_text[c_cnt], object_item->eventtext,
strcpy( info->c_alarm_alias[c_cnt], object_item->alias); sizeof(info->c_alarm_text[0]));
strncpy( info->c_alarm_alias[c_cnt], object_item->alias,
sizeof(info->c_alarm_alias[0]));
info->c_alarm_active[c_cnt] = object_item->status & mh_mEventStatus_NotRet; info->c_alarm_active[c_cnt] = object_item->status & mh_mEventStatus_NotRet;
info->c_alarm_exist[c_cnt] = 1; info->c_alarm_exist[c_cnt] = 1;
c_cnt++; c_cnt++;
...@@ -1534,8 +1540,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info) ...@@ -1534,8 +1540,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info)
case mh_eEventPrio_D: case mh_eEventPrio_D:
if ( d_cnt >= ALARM_INFO_D_SIZE) if ( d_cnt >= ALARM_INFO_D_SIZE)
break; break;
strcpy( info->d_alarm_text[d_cnt], object_item->eventtext); strncpy( info->d_alarm_text[d_cnt], object_item->eventtext,
strcpy( info->d_alarm_alias[d_cnt], object_item->alias); sizeof(info->d_alarm_text[0]));
strncpy( info->d_alarm_alias[d_cnt], object_item->alias,
sizeof(info->d_alarm_alias[0]));
info->d_alarm_active[d_cnt] = object_item->status & mh_mEventStatus_NotRet; info->d_alarm_active[d_cnt] = object_item->status & mh_mEventStatus_NotRet;
info->d_alarm_exist[d_cnt] = 1; info->d_alarm_exist[d_cnt] = 1;
d_cnt++; d_cnt++;
...@@ -1551,8 +1559,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info) ...@@ -1551,8 +1559,10 @@ int EvList::get_alarm_info( evlist_sAlarmInfo *info)
{ {
if ( i_cnt >= ALARM_INFO_I_SIZE) if ( i_cnt >= ALARM_INFO_I_SIZE)
break; break;
strcpy( info->i_alarm_text[i_cnt], object_item->eventtext); strncpy( info->i_alarm_text[i_cnt], object_item->eventtext,
strcpy( info->i_alarm_alias[i_cnt], object_item->alias); sizeof(info->i_alarm_text[0]));
strncpy( info->i_alarm_alias[i_cnt], object_item->alias,
sizeof(info->i_alarm_alias[0]));
info->i_alarm_active[i_cnt] = object_item->status & mh_mEventStatus_NotRet; info->i_alarm_active[i_cnt] = object_item->status & mh_mEventStatus_NotRet;
info->i_alarm_exist[i_cnt] = 1; info->i_alarm_exist[i_cnt] = 1;
i_cnt++; i_cnt++;
......
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