aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanJacobs2022-07-23 23:21:17 +0200
committerSanJacobs2022-07-23 23:21:17 +0200
commitdb37f3b69dc2d8d0a8994b1c1f0e3a55e07d4e62 (patch)
tree41f665791aed0513e00e6299f7d83d286564d022 /src
parentcfa1683bc90c8fa04294fd4e43c523fae0146405 (diff)
downloadsatscalc-db37f3b69dc2d8d0a8994b1c1f0e3a55e07d4e62.tar.gz
satscalc-db37f3b69dc2d8d0a8994b1c1f0e3a55e07d4e62.tar.bz2
satscalc-db37f3b69dc2d8d0a8994b1c1f0e3a55e07d4e62.zip
Fixed looping into garbage data bug
Diffstat (limited to 'src')
-rwxr-xr-xsrc/time.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/time.cpp b/src/time.cpp
index 8fd8931..ee8f139 100755
--- a/src/time.cpp
+++ b/src/time.cpp
@@ -177,10 +177,8 @@ workday::workday(const moment& previous_wrap,
// TODO: Implement a good system for this fuckin' paragraph:
// A. 50 % tillegg for arbeid inntil 2 timer før, eller inntil 3 timer etter ordinær arbeidstid når arbeidstiden ikke er forskjøvet og overtiden er varslet. Dersom det varsles overtid både før og etter ordinær arbeidstid betales de to første timene med 50 % tillegg og de øvrige med 100 % tillegg.
- for(timeblock& each_block : blocks){ // C++11 stuff right here.
- // FIXME: I think this is the source of the crash and infinite loop, because it reaches garbage data.
- // Limit it to total_timeblocks!
- // When it doesn't crash, it is because all the garbage moments are: 00:00 0-00-00
+ for(int ii=0; ii < total_timeblocks; ii++){
+ timeblock& each_block = blocks[ii];
std::cout << "pricing: " << timeprint(each_block) << std::endl;
if(each_block.hourcount() == 8) {
each_block.valuefactor = 7.5/8.0;